{"action":"created","comment":{"url":"https://api.github.com/repos/pulp/pulp/pulls/comments/82448657","pull_request_review_id":3358222,"id":82448657,"diff_hunk":"@@ -0,0 +1,138 @@\n+import errno\n+import os\n+import shutil\n+import stat\n+\n+from celery import task\n+from django.conf import settings as pulp_settings\n+\n+\n+def _working_dir_root(worker_name):\n+    \"\"\"Return the path to the working directory of a worker.\n+\n+    :param worker_name:     Name of worker for which path is requested\n+    :type  worker_name:     basestring\n+\n+    :returns: working_directory setting from server config\n+    :rtype:   str\n+    \"\"\"\n+    return os.path.join(pulp_settings.SERVER['working_directory'], worker_name)\n+\n+\n+def create_worker_working_directory(worker_name):\n+    \"\"\"Create a working directory for a worker.\n+\n+    Create a working directory inside the working_directory as specified in the setting file.\n+\n+    :param worker_name:     Name of worker that uses the working directory created\n+    :type  worker_name:     basestring\n+\n+    :returns: Path to the working directory for a worker\n+    :rtype:   str\n+    \"\"\"\n+    working_dir_root = _working_dir_root(worker_name)\n+    os.mkdir(working_dir_root)","path":"tasking/pulp/tasking/storage.py","position":34,"original_position":34,"commit_id":"6aa9bb706855cc200dea25c17b6000a153b1f087","original_commit_id":"6aa9bb706855cc200dea25c17b6000a153b1f087","user":{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},"body":"Should this suppress the exceptions if the directory already exists?","created_at":"2016-10-07T18:49:54Z","updated_at":"2016-10-07T18:58:23Z","html_url":"https://github.com/pulp/pulp/pull/2776#discussion_r82448657","pull_request_url":"https://api.github.com/repos/pulp/pulp/pulls/2776","_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments/82448657"},"html":{"href":"https://github.com/pulp/pulp/pull/2776#discussion_r82448657"},"pull_request":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2776"}}},"pull_request":{"url":"https://api.github.com/repos/pulp/pulp/pulls/2776","id":87537743,"html_url":"https://github.com/pulp/pulp/pull/2776","diff_url":"https://github.com/pulp/pulp/pull/2776.diff","patch_url":"https://github.com/pulp/pulp/pull/2776.patch","issue_url":"https://api.github.com/repos/pulp/pulp/issues/2776","number":2776,"state":"open","locked":false,"title":"Implement worker and task directory creation and cleanup","user":{"login":"BrnoPCmaniak","id":1249759,"avatar_url":"https://avatars.githubusercontent.com/u/1249759?v=3","gravatar_id":"","url":"https://api.github.com/users/BrnoPCmaniak","html_url":"https://github.com/BrnoPCmaniak","followers_url":"https://api.github.com/users/BrnoPCmaniak/followers","following_url":"https://api.github.com/users/BrnoPCmaniak/following{/other_user}","gists_url":"https://api.github.com/users/BrnoPCmaniak/gists{/gist_id}","starred_url":"https://api.github.com/users/BrnoPCmaniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrnoPCmaniak/subscriptions","organizations_url":"https://api.github.com/users/BrnoPCmaniak/orgs","repos_url":"https://api.github.com/users/BrnoPCmaniak/repos","events_url":"https://api.github.com/users/BrnoPCmaniak/events{/privacy}","received_events_url":"https://api.github.com/users/BrnoPCmaniak/received_events","type":"User","site_admin":false},"body":"closes #2281\r\nhttps://pulp.plan.io/issues/2281\r\n\r\nThis PR have to be merged into code created by https://github.com/pulp/pulp/pull/2771","created_at":"2016-09-30T17:54:13Z","updated_at":"2016-10-07T18:58:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a34502e9d92fbc852108eb2602973e2b388036d","assignee":{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false},"assignees":[{"login":"bmbouter","id":180319,"avatar_url":"https://avatars.githubusercontent.com/u/180319?v=3","gravatar_id":"","url":"https://api.github.com/users/bmbouter","html_url":"https://github.com/bmbouter","followers_url":"https://api.github.com/users/bmbouter/followers","following_url":"https://api.github.com/users/bmbouter/following{/other_user}","gists_url":"https://api.github.com/users/bmbouter/gists{/gist_id}","starred_url":"https://api.github.com/users/bmbouter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmbouter/subscriptions","organizations_url":"https://api.github.com/users/bmbouter/orgs","repos_url":"https://api.github.com/users/bmbouter/repos","events_url":"https://api.github.com/users/bmbouter/events{/privacy}","received_events_url":"https://api.github.com/users/bmbouter/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/pulp/pulp/pulls/2776/commits","review_comments_url":"https://api.github.com/repos/pulp/pulp/pulls/2776/comments","review_comment_url":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pulp/pulp/issues/2776/comments","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/6aa9bb706855cc200dea25c17b6000a153b1f087","head":{"label":"BrnoPCmaniak:worker_storage","ref":"worker_storage","sha":"6aa9bb706855cc200dea25c17b6000a153b1f087","user":{"login":"BrnoPCmaniak","id":1249759,"avatar_url":"https://avatars.githubusercontent.com/u/1249759?v=3","gravatar_id":"","url":"https://api.github.com/users/BrnoPCmaniak","html_url":"https://github.com/BrnoPCmaniak","followers_url":"https://api.github.com/users/BrnoPCmaniak/followers","following_url":"https://api.github.com/users/BrnoPCmaniak/following{/other_user}","gists_url":"https://api.github.com/users/BrnoPCmaniak/gists{/gist_id}","starred_url":"https://api.github.com/users/BrnoPCmaniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrnoPCmaniak/subscriptions","organizations_url":"https://api.github.com/users/BrnoPCmaniak/orgs","repos_url":"https://api.github.com/users/BrnoPCmaniak/repos","events_url":"https://api.github.com/users/BrnoPCmaniak/events{/privacy}","received_events_url":"https://api.github.com/users/BrnoPCmaniak/received_events","type":"User","site_admin":false},"repo":{"id":62882517,"name":"pulp","full_name":"BrnoPCmaniak/pulp","owner":{"login":"BrnoPCmaniak","id":1249759,"avatar_url":"https://avatars.githubusercontent.com/u/1249759?v=3","gravatar_id":"","url":"https://api.github.com/users/BrnoPCmaniak","html_url":"https://github.com/BrnoPCmaniak","followers_url":"https://api.github.com/users/BrnoPCmaniak/followers","following_url":"https://api.github.com/users/BrnoPCmaniak/following{/other_user}","gists_url":"https://api.github.com/users/BrnoPCmaniak/gists{/gist_id}","starred_url":"https://api.github.com/users/BrnoPCmaniak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrnoPCmaniak/subscriptions","organizations_url":"https://api.github.com/users/BrnoPCmaniak/orgs","repos_url":"https://api.github.com/users/BrnoPCmaniak/repos","events_url":"https://api.github.com/users/BrnoPCmaniak/events{/privacy}","received_events_url":"https://api.github.com/users/BrnoPCmaniak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BrnoPCmaniak/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":true,"url":"https://api.github.com/repos/BrnoPCmaniak/pulp","forks_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/forks","keys_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/teams","hooks_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/hooks","issue_events_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/events","assignees_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/tags","blobs_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/languages","stargazers_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/stargazers","contributors_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/contributors","subscribers_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/subscribers","subscription_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/subscription","commits_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/merges","archive_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/downloads","issues_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/labels{/name}","releases_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/BrnoPCmaniak/pulp/deployments","created_at":"2016-07-08T11:02:40Z","updated_at":"2016-07-08T11:02:45Z","pushed_at":"2016-10-07T18:32:06Z","git_url":"git://github.com/BrnoPCmaniak/pulp.git","ssh_url":"git@github.com:BrnoPCmaniak/pulp.git","clone_url":"https://github.com/BrnoPCmaniak/pulp.git","svn_url":"https://github.com/BrnoPCmaniak/pulp","homepage":"","size":92241,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pulp:3.0-dev","ref":"3.0-dev","sha":"c8ca7bcf8e77457f22639ab225be0b43a9e34014","user":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"repo":{"id":5314652,"name":"pulp","full_name":"pulp/pulp","owner":{"login":"pulp","id":2103606,"avatar_url":"https://avatars.githubusercontent.com/u/2103606?v=3","gravatar_id":"","url":"https://api.github.com/users/pulp","html_url":"https://github.com/pulp","followers_url":"https://api.github.com/users/pulp/followers","following_url":"https://api.github.com/users/pulp/following{/other_user}","gists_url":"https://api.github.com/users/pulp/gists{/gist_id}","starred_url":"https://api.github.com/users/pulp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pulp/subscriptions","organizations_url":"https://api.github.com/users/pulp/orgs","repos_url":"https://api.github.com/users/pulp/repos","events_url":"https://api.github.com/users/pulp/events{/privacy}","received_events_url":"https://api.github.com/users/pulp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pulp/pulp","description":"Repository for Pulp platform code, including the server and base admin and consumer clients","fork":false,"url":"https://api.github.com/repos/pulp/pulp","forks_url":"https://api.github.com/repos/pulp/pulp/forks","keys_url":"https://api.github.com/repos/pulp/pulp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pulp/pulp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pulp/pulp/teams","hooks_url":"https://api.github.com/repos/pulp/pulp/hooks","issue_events_url":"https://api.github.com/repos/pulp/pulp/issues/events{/number}","events_url":"https://api.github.com/repos/pulp/pulp/events","assignees_url":"https://api.github.com/repos/pulp/pulp/assignees{/user}","branches_url":"https://api.github.com/repos/pulp/pulp/branches{/branch}","tags_url":"https://api.github.com/repos/pulp/pulp/tags","blobs_url":"https://api.github.com/repos/pulp/pulp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pulp/pulp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pulp/pulp/git/refs{/sha}","trees_url":"https://api.github.com/repos/pulp/pulp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pulp/pulp/statuses/{sha}","languages_url":"https://api.github.com/repos/pulp/pulp/languages","stargazers_url":"https://api.github.com/repos/pulp/pulp/stargazers","contributors_url":"https://api.github.com/repos/pulp/pulp/contributors","subscribers_url":"https://api.github.com/repos/pulp/pulp/subscribers","subscription_url":"https://api.github.com/repos/pulp/pulp/subscription","commits_url":"https://api.github.com/repos/pulp/pulp/commits{/sha}","git_commits_url":"https://api.github.com/repos/pulp/pulp/git/commits{/sha}","comments_url":"https://api.github.com/repos/pulp/pulp/comments{/number}","issue_comment_url":"https://api.github.com/repos/pulp/pulp/issues/comments{/number}","contents_url":"https://api.github.com/repos/pulp/pulp/contents/{+path}","compare_url":"https://api.github.com/repos/pulp/pulp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pulp/pulp/merges","archive_url":"https://api.github.com/repos/pulp/pulp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pulp/pulp/downloads","issues_url":"https://api.github.com/repos/pulp/pulp/issues{/number}","pulls_url":"https://api.github.com/repos/pulp/pulp/pulls{/number}","milestones_url":"https://api.github.com/repos/pulp/pulp/milestones{/number}","notifications_url":"https://api.github.com/repos/pulp/pulp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pulp/pulp/labels{/name}","releases_url":"https://api.github.com/repos/pulp/pulp/releases{/id}","deployments_url":"https://api.github.com/repos/pulp/pulp/deployments","created_at":"2012-08-06T13:49:20Z","updated_at":"2016-10-07T17:37:31Z","pushed_at":"2016-10-07T18:41:37Z","git_url":"git://github.com/pulp/pulp.git","ssh_url":"git@github.com:pulp/pulp.git","clone_url":"https://github.com/pulp/pulp.git","svn_url":"https://github.com/pulp/pulp","homepage":"","size":103126,"stargazers_count":281,"watchers_count":281,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":111,"mirror_url":null,"open_issues_count":17,"forks":111,"open_issues":17,"watchers":281,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2776"},"html":{"href":"https://github.com/pulp/pulp/pull/2776"},"issue":{"href":"https://api.github.com/repos/pulp/pulp/issues/2776"},"comments":{"href":"https://api.github.com/repos/pulp/pulp/issues/2776/comments"},"review_comments":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2776/comments"},"review_comment":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pulp/pulp/pulls/2776/commits"},"statuses":{"href":"https://api.github.com/repos/pulp/pulp/statuses/6aa9bb706855cc200dea25c17b6000a153b1f087"}}}}
{"actor":{"display_login":"bmbouter"}}