{"action":"created","comment":{"url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments/65572204","id":65572204,"diff_hunk":"@@ -261,6 +261,9 @@ def set_selinux_context(self, path, con):\n         Returns exit result.\n         \"\"\"\n         if self.is_selinux_system():\n+            if not os.path.exists(path):","path":"azurelinuxagent/distro/default/osutil.py","position":13,"original_position":13,"commit_id":"a9667e0422c91b80cfd09c4dbb56df5921b679d8","original_commit_id":"a9667e0422c91b80cfd09c4dbb56df5921b679d8","user":{"login":"ahmetalpbalkan","id":159209,"avatar_url":"https://avatars.githubusercontent.com/u/159209?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetalpbalkan","html_url":"https://github.com/ahmetalpbalkan","followers_url":"https://api.github.com/users/ahmetalpbalkan/followers","following_url":"https://api.github.com/users/ahmetalpbalkan/following{/other_user}","gists_url":"https://api.github.com/users/ahmetalpbalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetalpbalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetalpbalkan/subscriptions","organizations_url":"https://api.github.com/users/ahmetalpbalkan/orgs","repos_url":"https://api.github.com/users/ahmetalpbalkan/repos","events_url":"https://api.github.com/users/ahmetalpbalkan/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetalpbalkan/received_events","type":"User","site_admin":false},"body":"I feel like this checks should not be inside the `set_selinux_context`/`chcon`/`chown` methods. Why don't we check the file before they get called? It does not make much sense to call multiple operations on a file that does not exist, plus this patch adds non-obvious logic to method names like chown/chmod.","created_at":"2016-06-02T16:23:14Z","updated_at":"2016-06-02T16:23:14Z","html_url":"https://github.com/Azure/WALinuxAgent/pull/206#discussion_r65572204","pull_request_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206","_links":{"self":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments/65572204"},"html":{"href":"https://github.com/Azure/WALinuxAgent/pull/206#discussion_r65572204"},"pull_request":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206"}}},"pull_request":{"url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206","id":72260755,"html_url":"https://github.com/Azure/WALinuxAgent/pull/206","diff_url":"https://github.com/Azure/WALinuxAgent/pull/206.diff","patch_url":"https://github.com/Azure/WALinuxAgent/pull/206.patch","issue_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/206","number":206,"state":"open","locked":false,"title":"Graceful failure when deploying keys [2.1]","user":{"login":"hglkrijger","id":2983483,"avatar_url":"https://avatars.githubusercontent.com/u/2983483?v=3","gravatar_id":"","url":"https://api.github.com/users/hglkrijger","html_url":"https://github.com/hglkrijger","followers_url":"https://api.github.com/users/hglkrijger/followers","following_url":"https://api.github.com/users/hglkrijger/following{/other_user}","gists_url":"https://api.github.com/users/hglkrijger/gists{/gist_id}","starred_url":"https://api.github.com/users/hglkrijger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hglkrijger/subscriptions","organizations_url":"https://api.github.com/users/hglkrijger/orgs","repos_url":"https://api.github.com/users/hglkrijger/repos","events_url":"https://api.github.com/users/hglkrijger/events{/privacy}","received_events_url":"https://api.github.com/users/hglkrijger/received_events","type":"User","site_admin":false},"body":"check whether files exist before trying to chmod/chown/chcon. partially addresses #104; 2.1 does already support non-RSA keys.","created_at":"2016-06-01T22:10:43Z","updated_at":"2016-06-02T16:23:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e60150721b7ed3ddd96ad3e64661ffe1215bd885","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206/commits","review_comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206/comments","review_comment_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/206/comments","statuses_url":"https://api.github.com/repos/Azure/WALinuxAgent/statuses/a9667e0422c91b80cfd09c4dbb56df5921b679d8","head":{"label":"hglkrijger:bugfix/github-104","ref":"bugfix/github-104","sha":"a9667e0422c91b80cfd09c4dbb56df5921b679d8","user":{"login":"hglkrijger","id":2983483,"avatar_url":"https://avatars.githubusercontent.com/u/2983483?v=3","gravatar_id":"","url":"https://api.github.com/users/hglkrijger","html_url":"https://github.com/hglkrijger","followers_url":"https://api.github.com/users/hglkrijger/followers","following_url":"https://api.github.com/users/hglkrijger/following{/other_user}","gists_url":"https://api.github.com/users/hglkrijger/gists{/gist_id}","starred_url":"https://api.github.com/users/hglkrijger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hglkrijger/subscriptions","organizations_url":"https://api.github.com/users/hglkrijger/orgs","repos_url":"https://api.github.com/users/hglkrijger/repos","events_url":"https://api.github.com/users/hglkrijger/events{/privacy}","received_events_url":"https://api.github.com/users/hglkrijger/received_events","type":"User","site_admin":false},"repo":{"id":59594158,"name":"WALinuxAgent","full_name":"hglkrijger/WALinuxAgent","owner":{"login":"hglkrijger","id":2983483,"avatar_url":"https://avatars.githubusercontent.com/u/2983483?v=3","gravatar_id":"","url":"https://api.github.com/users/hglkrijger","html_url":"https://github.com/hglkrijger","followers_url":"https://api.github.com/users/hglkrijger/followers","following_url":"https://api.github.com/users/hglkrijger/following{/other_user}","gists_url":"https://api.github.com/users/hglkrijger/gists{/gist_id}","starred_url":"https://api.github.com/users/hglkrijger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hglkrijger/subscriptions","organizations_url":"https://api.github.com/users/hglkrijger/orgs","repos_url":"https://api.github.com/users/hglkrijger/repos","events_url":"https://api.github.com/users/hglkrijger/events{/privacy}","received_events_url":"https://api.github.com/users/hglkrijger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hglkrijger/WALinuxAgent","description":"The Microsoft Azure Linux Agent ","fork":true,"url":"https://api.github.com/repos/hglkrijger/WALinuxAgent","forks_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/forks","keys_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/teams","hooks_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/hooks","issue_events_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/issues/events{/number}","events_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/events","assignees_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/assignees{/user}","branches_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/branches{/branch}","tags_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/tags","blobs_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/git/refs{/sha}","trees_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/statuses/{sha}","languages_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/languages","stargazers_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/stargazers","contributors_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/contributors","subscribers_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/subscribers","subscription_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/subscription","commits_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/commits{/sha}","git_commits_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/git/commits{/sha}","comments_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/comments{/number}","issue_comment_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/issues/comments{/number}","contents_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/contents/{+path}","compare_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/merges","archive_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/downloads","issues_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/issues{/number}","pulls_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/pulls{/number}","milestones_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/milestones{/number}","notifications_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/labels{/name}","releases_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/releases{/id}","deployments_url":"https://api.github.com/repos/hglkrijger/WALinuxAgent/deployments","created_at":"2016-05-24T17:28:46Z","updated_at":"2016-05-24T17:28:47Z","pushed_at":"2016-06-02T16:04:43Z","git_url":"git://github.com/hglkrijger/WALinuxAgent.git","ssh_url":"git@github.com:hglkrijger/WALinuxAgent.git","clone_url":"https://github.com/hglkrijger/WALinuxAgent.git","svn_url":"https://github.com/hglkrijger/WALinuxAgent","homepage":"http://azure.microsoft.com/","size":2694,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"Azure:develop","ref":"develop","sha":"922c569c862cc9c98f291399fa79ab4fff8b22bd","user":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"repo":{"id":4576639,"name":"WALinuxAgent","full_name":"Azure/WALinuxAgent","owner":{"login":"Azure","id":6844498,"avatar_url":"https://avatars.githubusercontent.com/u/6844498?v=3","gravatar_id":"","url":"https://api.github.com/users/Azure","html_url":"https://github.com/Azure","followers_url":"https://api.github.com/users/Azure/followers","following_url":"https://api.github.com/users/Azure/following{/other_user}","gists_url":"https://api.github.com/users/Azure/gists{/gist_id}","starred_url":"https://api.github.com/users/Azure/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Azure/subscriptions","organizations_url":"https://api.github.com/users/Azure/orgs","repos_url":"https://api.github.com/users/Azure/repos","events_url":"https://api.github.com/users/Azure/events{/privacy}","received_events_url":"https://api.github.com/users/Azure/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Azure/WALinuxAgent","description":"The Microsoft Azure Linux Agent ","fork":false,"url":"https://api.github.com/repos/Azure/WALinuxAgent","forks_url":"https://api.github.com/repos/Azure/WALinuxAgent/forks","keys_url":"https://api.github.com/repos/Azure/WALinuxAgent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Azure/WALinuxAgent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Azure/WALinuxAgent/teams","hooks_url":"https://api.github.com/repos/Azure/WALinuxAgent/hooks","issue_events_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/events{/number}","events_url":"https://api.github.com/repos/Azure/WALinuxAgent/events","assignees_url":"https://api.github.com/repos/Azure/WALinuxAgent/assignees{/user}","branches_url":"https://api.github.com/repos/Azure/WALinuxAgent/branches{/branch}","tags_url":"https://api.github.com/repos/Azure/WALinuxAgent/tags","blobs_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Azure/WALinuxAgent/statuses/{sha}","languages_url":"https://api.github.com/repos/Azure/WALinuxAgent/languages","stargazers_url":"https://api.github.com/repos/Azure/WALinuxAgent/stargazers","contributors_url":"https://api.github.com/repos/Azure/WALinuxAgent/contributors","subscribers_url":"https://api.github.com/repos/Azure/WALinuxAgent/subscribers","subscription_url":"https://api.github.com/repos/Azure/WALinuxAgent/subscription","commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Azure/WALinuxAgent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Azure/WALinuxAgent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Azure/WALinuxAgent/contents/{+path}","compare_url":"https://api.github.com/repos/Azure/WALinuxAgent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Azure/WALinuxAgent/merges","archive_url":"https://api.github.com/repos/Azure/WALinuxAgent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Azure/WALinuxAgent/downloads","issues_url":"https://api.github.com/repos/Azure/WALinuxAgent/issues{/number}","pulls_url":"https://api.github.com/repos/Azure/WALinuxAgent/pulls{/number}","milestones_url":"https://api.github.com/repos/Azure/WALinuxAgent/milestones{/number}","notifications_url":"https://api.github.com/repos/Azure/WALinuxAgent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Azure/WALinuxAgent/labels{/name}","releases_url":"https://api.github.com/repos/Azure/WALinuxAgent/releases{/id}","deployments_url":"https://api.github.com/repos/Azure/WALinuxAgent/deployments","created_at":"2012-06-06T18:55:55Z","updated_at":"2016-05-26T15:19:03Z","pushed_at":"2016-06-01T23:26:59Z","git_url":"git://github.com/Azure/WALinuxAgent.git","ssh_url":"git@github.com:Azure/WALinuxAgent.git","clone_url":"https://github.com/Azure/WALinuxAgent.git","svn_url":"https://github.com/Azure/WALinuxAgent","homepage":"http://azure.microsoft.com/","size":3074,"stargazers_count":129,"watchers_count":129,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":111,"mirror_url":null,"open_issues_count":32,"forks":111,"open_issues":32,"watchers":129,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206"},"html":{"href":"https://github.com/Azure/WALinuxAgent/pull/206"},"issue":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/issues/206"},"comments":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/issues/206/comments"},"review_comments":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206/comments"},"review_comment":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/pulls/206/commits"},"statuses":{"href":"https://api.github.com/repos/Azure/WALinuxAgent/statuses/a9667e0422c91b80cfd09c4dbb56df5921b679d8"}}}}
{"actor":{"display_login":"ahmetalpbalkan"}}