{"action":"created","comment":{"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/comments/72887518","id":72887518,"diff_hunk":"@@ -329,6 +332,20 @@ def create_custom_env_file_on_target(self, environment):\n     def move(self, source, target):\n         shutil.move(source, target)\n \n+    def _get_certificate_file(self):\n+        cert_file = self.cloudify_agent['local_rest_cert_file']\n+\n+        if not os.path.exists(cert_file):\n+            cert_content = self.cloudify_agent.get('rest_cert_content')\n+\n+            if not cert_content:\n+                return None\n+\n+            with open(cert_file) as f:\n+                f.write(cert_content.decode('string-escape'))","path":"cloudify_agent/installer/__init__.py","position":32,"original_position":42,"commit_id":"3f2d2e068631dd7cf3699989a952205f8e98c6b5","original_commit_id":"bfc3939ffd765a74c37623987e48d627fd49533c","user":{"login":"tehasdf","id":790215,"avatar_url":"https://avatars.githubusercontent.com/u/790215?v=3","gravatar_id":"","url":"https://api.github.com/users/tehasdf","html_url":"https://github.com/tehasdf","followers_url":"https://api.github.com/users/tehasdf/followers","following_url":"https://api.github.com/users/tehasdf/following{/other_user}","gists_url":"https://api.github.com/users/tehasdf/gists{/gist_id}","starred_url":"https://api.github.com/users/tehasdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tehasdf/subscriptions","organizations_url":"https://api.github.com/users/tehasdf/orgs","repos_url":"https://api.github.com/users/tehasdf/repos","events_url":"https://api.github.com/users/tehasdf/events{/privacy}","received_events_url":"https://api.github.com/users/tehasdf/received_events","type":"User","site_admin":false},"body":"the cert has \"\\\\n\" instead of newlines in it - ie. the two characters \"backslash, lowercase letter N\", instead of a single character \"\\n\" - ie. \"newline\". `.decode('string-escape')` decodes the escape sequences, ie. turns \"\\\\n\" into \"\\n\" (it would also eg. turn \"\\\\r\" into \"\\r\", or \"\\\\x20\" into \" \" - but the cert is of course pem-encoded, so the only escape sequence inside it, is \"\\\\n\")","created_at":"2016-07-30T13:40:14Z","updated_at":"2016-07-30T13:40:14Z","html_url":"https://github.com/cloudify-cosmo/cloudify-agent/pull/146#discussion_r72887518","pull_request_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146","_links":{"self":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/comments/72887518"},"html":{"href":"https://github.com/cloudify-cosmo/cloudify-agent/pull/146#discussion_r72887518"},"pull_request":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146"}}},"pull_request":{"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146","id":79360405,"html_url":"https://github.com/cloudify-cosmo/cloudify-agent/pull/146","diff_url":"https://github.com/cloudify-cosmo/cloudify-agent/pull/146.diff","patch_url":"https://github.com/cloudify-cosmo/cloudify-agent/pull/146.patch","issue_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/issues/146","number":146,"state":"open","locked":false,"title":"CFY-5135 Upload cert to the agent host before downloading agent package","user":{"login":"tehasdf","id":790215,"avatar_url":"https://avatars.githubusercontent.com/u/790215?v=3","gravatar_id":"","url":"https://api.github.com/users/tehasdf","html_url":"https://github.com/tehasdf","followers_url":"https://api.github.com/users/tehasdf/followers","following_url":"https://api.github.com/users/tehasdf/following{/other_user}","gists_url":"https://api.github.com/users/tehasdf/gists{/gist_id}","starred_url":"https://api.github.com/users/tehasdf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tehasdf/subscriptions","organizations_url":"https://api.github.com/users/tehasdf/orgs","repos_url":"https://api.github.com/users/tehasdf/repos","events_url":"https://api.github.com/users/tehasdf/events{/privacy}","received_events_url":"https://api.github.com/users/tehasdf/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-29T13:35:50Z","updated_at":"2016-07-30T13:40:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae3e6b5f94260b8419c885250a9e9bbf4f468f52","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146/commits","review_comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146/comments","review_comment_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/issues/146/comments","statuses_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/statuses/3f2d2e068631dd7cf3699989a952205f8e98c6b5","head":{"label":"codilime:runner-download-cert-341","ref":"runner-download-cert-341","sha":"3f2d2e068631dd7cf3699989a952205f8e98c6b5","user":{"login":"codilime","id":2143695,"avatar_url":"https://avatars.githubusercontent.com/u/2143695?v=3","gravatar_id":"","url":"https://api.github.com/users/codilime","html_url":"https://github.com/codilime","followers_url":"https://api.github.com/users/codilime/followers","following_url":"https://api.github.com/users/codilime/following{/other_user}","gists_url":"https://api.github.com/users/codilime/gists{/gist_id}","starred_url":"https://api.github.com/users/codilime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codilime/subscriptions","organizations_url":"https://api.github.com/users/codilime/orgs","repos_url":"https://api.github.com/users/codilime/repos","events_url":"https://api.github.com/users/codilime/events{/privacy}","received_events_url":"https://api.github.com/users/codilime/received_events","type":"Organization","site_admin":false},"repo":{"id":39193241,"name":"cloudify-agent","full_name":"codilime/cloudify-agent","owner":{"login":"codilime","id":2143695,"avatar_url":"https://avatars.githubusercontent.com/u/2143695?v=3","gravatar_id":"","url":"https://api.github.com/users/codilime","html_url":"https://github.com/codilime","followers_url":"https://api.github.com/users/codilime/followers","following_url":"https://api.github.com/users/codilime/following{/other_user}","gists_url":"https://api.github.com/users/codilime/gists{/gist_id}","starred_url":"https://api.github.com/users/codilime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codilime/subscriptions","organizations_url":"https://api.github.com/users/codilime/orgs","repos_url":"https://api.github.com/users/codilime/repos","events_url":"https://api.github.com/users/codilime/events{/privacy}","received_events_url":"https://api.github.com/users/codilime/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codilime/cloudify-agent","description":"Cloudify's Agent module","fork":true,"url":"https://api.github.com/repos/codilime/cloudify-agent","forks_url":"https://api.github.com/repos/codilime/cloudify-agent/forks","keys_url":"https://api.github.com/repos/codilime/cloudify-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codilime/cloudify-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codilime/cloudify-agent/teams","hooks_url":"https://api.github.com/repos/codilime/cloudify-agent/hooks","issue_events_url":"https://api.github.com/repos/codilime/cloudify-agent/issues/events{/number}","events_url":"https://api.github.com/repos/codilime/cloudify-agent/events","assignees_url":"https://api.github.com/repos/codilime/cloudify-agent/assignees{/user}","branches_url":"https://api.github.com/repos/codilime/cloudify-agent/branches{/branch}","tags_url":"https://api.github.com/repos/codilime/cloudify-agent/tags","blobs_url":"https://api.github.com/repos/codilime/cloudify-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codilime/cloudify-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codilime/cloudify-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/codilime/cloudify-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codilime/cloudify-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/codilime/cloudify-agent/languages","stargazers_url":"https://api.github.com/repos/codilime/cloudify-agent/stargazers","contributors_url":"https://api.github.com/repos/codilime/cloudify-agent/contributors","subscribers_url":"https://api.github.com/repos/codilime/cloudify-agent/subscribers","subscription_url":"https://api.github.com/repos/codilime/cloudify-agent/subscription","commits_url":"https://api.github.com/repos/codilime/cloudify-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/codilime/cloudify-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/codilime/cloudify-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/codilime/cloudify-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/codilime/cloudify-agent/contents/{+path}","compare_url":"https://api.github.com/repos/codilime/cloudify-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codilime/cloudify-agent/merges","archive_url":"https://api.github.com/repos/codilime/cloudify-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codilime/cloudify-agent/downloads","issues_url":"https://api.github.com/repos/codilime/cloudify-agent/issues{/number}","pulls_url":"https://api.github.com/repos/codilime/cloudify-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/codilime/cloudify-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/codilime/cloudify-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codilime/cloudify-agent/labels{/name}","releases_url":"https://api.github.com/repos/codilime/cloudify-agent/releases{/id}","deployments_url":"https://api.github.com/repos/codilime/cloudify-agent/deployments","created_at":"2015-07-16T11:29:43Z","updated_at":"2015-07-16T11:29:44Z","pushed_at":"2016-07-29T16:09:38Z","git_url":"git://github.com/codilime/cloudify-agent.git","ssh_url":"git@github.com:codilime/cloudify-agent.git","clone_url":"https://github.com/codilime/cloudify-agent.git","svn_url":"https://github.com/codilime/cloudify-agent","homepage":null,"size":22706,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cloudify-cosmo:3.4.1-build","ref":"3.4.1-build","sha":"417b81f395ea959e19aef29b219f87cfdb7691f5","user":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"repo":{"id":34351616,"name":"cloudify-agent","full_name":"cloudify-cosmo/cloudify-agent","owner":{"login":"cloudify-cosmo","id":6260555,"avatar_url":"https://avatars.githubusercontent.com/u/6260555?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudify-cosmo","html_url":"https://github.com/cloudify-cosmo","followers_url":"https://api.github.com/users/cloudify-cosmo/followers","following_url":"https://api.github.com/users/cloudify-cosmo/following{/other_user}","gists_url":"https://api.github.com/users/cloudify-cosmo/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudify-cosmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudify-cosmo/subscriptions","organizations_url":"https://api.github.com/users/cloudify-cosmo/orgs","repos_url":"https://api.github.com/users/cloudify-cosmo/repos","events_url":"https://api.github.com/users/cloudify-cosmo/events{/privacy}","received_events_url":"https://api.github.com/users/cloudify-cosmo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudify-cosmo/cloudify-agent","description":"Cloudify's Agent module","fork":false,"url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent","forks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/forks","keys_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/teams","hooks_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/hooks","issue_events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/issues/events{/number}","events_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/events","assignees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/assignees{/user}","branches_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/branches{/branch}","tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/tags","blobs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/languages","stargazers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/stargazers","contributors_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/contributors","subscribers_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/subscribers","subscription_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/subscription","commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/contents/{+path}","compare_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/merges","archive_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/downloads","issues_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/issues{/number}","pulls_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/labels{/name}","releases_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/releases{/id}","deployments_url":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/deployments","created_at":"2015-04-21T20:53:01Z","updated_at":"2016-05-24T08:33:10Z","pushed_at":"2016-07-29T19:15:11Z","git_url":"git://github.com/cloudify-cosmo/cloudify-agent.git","ssh_url":"git@github.com:cloudify-cosmo/cloudify-agent.git","clone_url":"https://github.com/cloudify-cosmo/cloudify-agent.git","svn_url":"https://github.com/cloudify-cosmo/cloudify-agent","homepage":null,"size":22838,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":11,"forks":10,"open_issues":11,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146"},"html":{"href":"https://github.com/cloudify-cosmo/cloudify-agent/pull/146"},"issue":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/issues/146"},"comments":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/issues/146/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/pulls/146/commits"},"statuses":{"href":"https://api.github.com/repos/cloudify-cosmo/cloudify-agent/statuses/3f2d2e068631dd7cf3699989a952205f8e98c6b5"}}}}
{"actor":{"display_login":"tehasdf"}}