{"action":"created","comment":{"url":"https://api.github.com/repos/rancherio/python-agent/pulls/comments/28924639","id":28924639,"diff_hunk":"@@ -192,13 +192,56 @@ def _is_instance_active(self, instance, host):\n \n     @staticmethod\n     def _get_docker_client(host):\n-        cluster_connection = \"\"\n+        cluster_connection = None\n+        tls_config = None\n         try:\n             cluster_connection = host['clusterConnection']\n+            if cluster_connection.startswith('https'):\n+                try:\n+                    account_id = host['accountId']\n+                    ca_crt = host['caCrt']\n+                    client_crt = host['clientCrt']\n+                    client_key = host['clientKey']\n+\n+                    client_certs_dir = Config.client_certs_dir()\n+                    acct_client_cert_dir = \\\n+                        '{0}/{1}'.format(client_certs_dir, account_id)\n+                    if not path.exists(acct_client_cert_dir):\n+                        log.debug('Creating client cert directory: %s',\n+                                  acct_client_cert_dir)\n+                        makedirs(acct_client_cert_dir)\n+                    if ca_crt:\n+                        log.debug('Writing cert auth')\n+                        with open(acct_client_cert_dir + '/ca.crt', 'w') as f:","path":"cattle/plugins/docker/compute.py","position":41,"original_position":41,"commit_id":"9ed23fb358a721cc91bb15bcb835f09b4a733996","original_commit_id":"9ed23fb358a721cc91bb15bcb835f09b4a733996","user":{"login":"cjellick","id":2473240,"avatar_url":"https://avatars.githubusercontent.com/u/2473240?v=3","gravatar_id":"","url":"https://api.github.com/users/cjellick","html_url":"https://github.com/cjellick","followers_url":"https://api.github.com/users/cjellick/followers","following_url":"https://api.github.com/users/cjellick/following{/other_user}","gists_url":"https://api.github.com/users/cjellick/gists{/gist_id}","starred_url":"https://api.github.com/users/cjellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjellick/subscriptions","organizations_url":"https://api.github.com/users/cjellick/orgs","repos_url":"https://api.github.com/users/cjellick/repos","events_url":"https://api.github.com/users/cjellick/events{/privacy}","received_events_url":"https://api.github.com/users/cjellick/received_events","type":"User","site_admin":false},"body":"Ah, sorry I didn't notice this in the last review, but this should probably use `os.path.join()`","created_at":"2015-04-22T23:27:53Z","updated_at":"2015-04-22T23:27:53Z","html_url":"https://github.com/rancherio/python-agent/pull/104#discussion_r28924639","pull_request_url":"https://api.github.com/repos/rancherio/python-agent/pulls/104","_links":{"self":{"href":"https://api.github.com/repos/rancherio/python-agent/pulls/comments/28924639"},"html":{"href":"https://github.com/rancherio/python-agent/pull/104#discussion_r28924639"},"pull_request":{"href":"https://api.github.com/repos/rancherio/python-agent/pulls/104"}}},"pull_request":{"url":"https://api.github.com/repos/rancherio/python-agent/pulls/104","id":33501801,"html_url":"https://github.com/rancherio/python-agent/pull/104","diff_url":"https://github.com/rancherio/python-agent/pull/104.diff","patch_url":"https://github.com/rancherio/python-agent/pull/104.patch","issue_url":"https://api.github.com/repos/rancherio/python-agent/issues/104","number":104,"state":"open","locked":false,"title":"First pass at SSL support for clusters","user":{"login":"sonchang","id":8651231,"avatar_url":"https://avatars.githubusercontent.com/u/8651231?v=3","gravatar_id":"","url":"https://api.github.com/users/sonchang","html_url":"https://github.com/sonchang","followers_url":"https://api.github.com/users/sonchang/followers","following_url":"https://api.github.com/users/sonchang/following{/other_user}","gists_url":"https://api.github.com/users/sonchang/gists{/gist_id}","starred_url":"https://api.github.com/users/sonchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonchang/subscriptions","organizations_url":"https://api.github.com/users/sonchang/orgs","repos_url":"https://api.github.com/users/sonchang/repos","events_url":"https://api.github.com/users/sonchang/events{/privacy}","received_events_url":"https://api.github.com/users/sonchang/received_events","type":"User","site_admin":false},"body":"This should still be backwards compatible with the current cattle (without my new changes).\r\nOriginally, I was hoping to submit my cattle PR some time tomorrow, but will likely be late Monday since I'll be busy reviewing James's PR.","created_at":"2015-04-16T23:13:56Z","updated_at":"2015-04-22T23:27:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6dd40376a232749e11e40aeaaddbadc6c1817144","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rancherio/python-agent/pulls/104/commits","review_comments_url":"https://api.github.com/repos/rancherio/python-agent/pulls/104/comments","review_comment_url":"https://api.github.com/repos/rancherio/python-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rancherio/python-agent/issues/104/comments","statuses_url":"https://api.github.com/repos/rancherio/python-agent/statuses/9ed23fb358a721cc91bb15bcb835f09b4a733996","head":{"label":"sonchang:docker_ssl","ref":"docker_ssl","sha":"9ed23fb358a721cc91bb15bcb835f09b4a733996","user":{"login":"sonchang","id":8651231,"avatar_url":"https://avatars.githubusercontent.com/u/8651231?v=3","gravatar_id":"","url":"https://api.github.com/users/sonchang","html_url":"https://github.com/sonchang","followers_url":"https://api.github.com/users/sonchang/followers","following_url":"https://api.github.com/users/sonchang/following{/other_user}","gists_url":"https://api.github.com/users/sonchang/gists{/gist_id}","starred_url":"https://api.github.com/users/sonchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonchang/subscriptions","organizations_url":"https://api.github.com/users/sonchang/orgs","repos_url":"https://api.github.com/users/sonchang/repos","events_url":"https://api.github.com/users/sonchang/events{/privacy}","received_events_url":"https://api.github.com/users/sonchang/received_events","type":"User","site_admin":false},"repo":{"id":29026834,"name":"python-agent","full_name":"sonchang/python-agent","owner":{"login":"sonchang","id":8651231,"avatar_url":"https://avatars.githubusercontent.com/u/8651231?v=3","gravatar_id":"","url":"https://api.github.com/users/sonchang","html_url":"https://github.com/sonchang","followers_url":"https://api.github.com/users/sonchang/followers","following_url":"https://api.github.com/users/sonchang/following{/other_user}","gists_url":"https://api.github.com/users/sonchang/gists{/gist_id}","starred_url":"https://api.github.com/users/sonchang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonchang/subscriptions","organizations_url":"https://api.github.com/users/sonchang/orgs","repos_url":"https://api.github.com/users/sonchang/repos","events_url":"https://api.github.com/users/sonchang/events{/privacy}","received_events_url":"https://api.github.com/users/sonchang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sonchang/python-agent","description":"Python agent for Rancher","fork":true,"url":"https://api.github.com/repos/sonchang/python-agent","forks_url":"https://api.github.com/repos/sonchang/python-agent/forks","keys_url":"https://api.github.com/repos/sonchang/python-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sonchang/python-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sonchang/python-agent/teams","hooks_url":"https://api.github.com/repos/sonchang/python-agent/hooks","issue_events_url":"https://api.github.com/repos/sonchang/python-agent/issues/events{/number}","events_url":"https://api.github.com/repos/sonchang/python-agent/events","assignees_url":"https://api.github.com/repos/sonchang/python-agent/assignees{/user}","branches_url":"https://api.github.com/repos/sonchang/python-agent/branches{/branch}","tags_url":"https://api.github.com/repos/sonchang/python-agent/tags","blobs_url":"https://api.github.com/repos/sonchang/python-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sonchang/python-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sonchang/python-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/sonchang/python-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sonchang/python-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/sonchang/python-agent/languages","stargazers_url":"https://api.github.com/repos/sonchang/python-agent/stargazers","contributors_url":"https://api.github.com/repos/sonchang/python-agent/contributors","subscribers_url":"https://api.github.com/repos/sonchang/python-agent/subscribers","subscription_url":"https://api.github.com/repos/sonchang/python-agent/subscription","commits_url":"https://api.github.com/repos/sonchang/python-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/sonchang/python-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/sonchang/python-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/sonchang/python-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/sonchang/python-agent/contents/{+path}","compare_url":"https://api.github.com/repos/sonchang/python-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sonchang/python-agent/merges","archive_url":"https://api.github.com/repos/sonchang/python-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sonchang/python-agent/downloads","issues_url":"https://api.github.com/repos/sonchang/python-agent/issues{/number}","pulls_url":"https://api.github.com/repos/sonchang/python-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/sonchang/python-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/sonchang/python-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sonchang/python-agent/labels{/name}","releases_url":"https://api.github.com/repos/sonchang/python-agent/releases{/id}","created_at":"2015-01-09T17:18:13Z","updated_at":"2015-04-16T23:14:54Z","pushed_at":"2015-04-22T23:23:13Z","git_url":"git://github.com/sonchang/python-agent.git","ssh_url":"git@github.com:sonchang/python-agent.git","clone_url":"https://github.com/sonchang/python-agent.git","svn_url":"https://github.com/sonchang/python-agent","homepage":null,"size":5269,"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":"rancherio:master","ref":"master","sha":"1b87b33d26dcb0bc875b4982a2de29e0bc1deb54","user":{"login":"rancherio","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancherio","html_url":"https://github.com/rancherio","followers_url":"https://api.github.com/users/rancherio/followers","following_url":"https://api.github.com/users/rancherio/following{/other_user}","gists_url":"https://api.github.com/users/rancherio/gists{/gist_id}","starred_url":"https://api.github.com/users/rancherio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancherio/subscriptions","organizations_url":"https://api.github.com/users/rancherio/orgs","repos_url":"https://api.github.com/users/rancherio/repos","events_url":"https://api.github.com/users/rancherio/events{/privacy}","received_events_url":"https://api.github.com/users/rancherio/received_events","type":"Organization","site_admin":false},"repo":{"id":26792702,"name":"python-agent","full_name":"rancherio/python-agent","owner":{"login":"rancherio","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancherio","html_url":"https://github.com/rancherio","followers_url":"https://api.github.com/users/rancherio/followers","following_url":"https://api.github.com/users/rancherio/following{/other_user}","gists_url":"https://api.github.com/users/rancherio/gists{/gist_id}","starred_url":"https://api.github.com/users/rancherio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancherio/subscriptions","organizations_url":"https://api.github.com/users/rancherio/orgs","repos_url":"https://api.github.com/users/rancherio/repos","events_url":"https://api.github.com/users/rancherio/events{/privacy}","received_events_url":"https://api.github.com/users/rancherio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rancherio/python-agent","description":"Python agent for Rancher","fork":false,"url":"https://api.github.com/repos/rancherio/python-agent","forks_url":"https://api.github.com/repos/rancherio/python-agent/forks","keys_url":"https://api.github.com/repos/rancherio/python-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rancherio/python-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rancherio/python-agent/teams","hooks_url":"https://api.github.com/repos/rancherio/python-agent/hooks","issue_events_url":"https://api.github.com/repos/rancherio/python-agent/issues/events{/number}","events_url":"https://api.github.com/repos/rancherio/python-agent/events","assignees_url":"https://api.github.com/repos/rancherio/python-agent/assignees{/user}","branches_url":"https://api.github.com/repos/rancherio/python-agent/branches{/branch}","tags_url":"https://api.github.com/repos/rancherio/python-agent/tags","blobs_url":"https://api.github.com/repos/rancherio/python-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rancherio/python-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rancherio/python-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/rancherio/python-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rancherio/python-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/rancherio/python-agent/languages","stargazers_url":"https://api.github.com/repos/rancherio/python-agent/stargazers","contributors_url":"https://api.github.com/repos/rancherio/python-agent/contributors","subscribers_url":"https://api.github.com/repos/rancherio/python-agent/subscribers","subscription_url":"https://api.github.com/repos/rancherio/python-agent/subscription","commits_url":"https://api.github.com/repos/rancherio/python-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/rancherio/python-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/rancherio/python-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/rancherio/python-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/rancherio/python-agent/contents/{+path}","compare_url":"https://api.github.com/repos/rancherio/python-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rancherio/python-agent/merges","archive_url":"https://api.github.com/repos/rancherio/python-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rancherio/python-agent/downloads","issues_url":"https://api.github.com/repos/rancherio/python-agent/issues{/number}","pulls_url":"https://api.github.com/repos/rancherio/python-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/rancherio/python-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/rancherio/python-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rancherio/python-agent/labels{/name}","releases_url":"https://api.github.com/repos/rancherio/python-agent/releases{/id}","created_at":"2014-11-18T05:00:53Z","updated_at":"2015-04-15T22:48:27Z","pushed_at":"2015-04-22T23:23:14Z","git_url":"git://github.com/rancherio/python-agent.git","ssh_url":"git@github.com:rancherio/python-agent.git","clone_url":"https://github.com/rancherio/python-agent.git","svn_url":"https://github.com/rancherio/python-agent","homepage":null,"size":7126,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":3,"forks":11,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rancherio/python-agent/pulls/104"},"html":{"href":"https://github.com/rancherio/python-agent/pull/104"},"issue":{"href":"https://api.github.com/repos/rancherio/python-agent/issues/104"},"comments":{"href":"https://api.github.com/repos/rancherio/python-agent/issues/104/comments"},"review_comments":{"href":"https://api.github.com/repos/rancherio/python-agent/pulls/104/comments"},"review_comment":{"href":"https://api.github.com/repos/rancherio/python-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rancherio/python-agent/pulls/104/commits"},"statuses":{"href":"https://api.github.com/repos/rancherio/python-agent/statuses/9ed23fb358a721cc91bb15bcb835f09b4a733996"}}}}