{"action":"created","comment":{"url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments/60467136","id":60467136,"diff_hunk":"@@ -195,3 +197,18 @@ def flatten(d, parent_key=prefix, sep='_'):\n             return items\n \n         return flatten(params)\n+\n+    @gen.coroutine\n+    def _log_account_name(self, *args, **kwargs):\n+        if not RightScaleBaseActor.account_name:\n+            ca_resource = self._client._client.cloud_accounts\n+            cloud_accounts = yield self._client.show(ca_resource)\n+            account = yield self._client.show(cloud_accounts[0].account)\n+            RightScaleBaseActor.account_name = account.soul['name']\n+            log.warn('RightScale account name: %s' % account.soul['name'])\n+\n+    @gen.coroutine\n+    def execute(self, *args, **kwargs):\n+        self._log_account_name()","path":"kingpin/actors/rightscale/base.py","position":25,"original_position":25,"commit_id":"99530917cc7c7fa6c3cc2840e5d70d3171cc39c2","original_commit_id":"99530917cc7c7fa6c3cc2840e5d70d3171cc39c2","user":{"login":"siminm","id":3210918,"avatar_url":"https://avatars.githubusercontent.com/u/3210918?v=3","gravatar_id":"","url":"https://api.github.com/users/siminm","html_url":"https://github.com/siminm","followers_url":"https://api.github.com/users/siminm/followers","following_url":"https://api.github.com/users/siminm/following{/other_user}","gists_url":"https://api.github.com/users/siminm/gists{/gist_id}","starred_url":"https://api.github.com/users/siminm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siminm/subscriptions","organizations_url":"https://api.github.com/users/siminm/orgs","repos_url":"https://api.github.com/users/siminm/repos","events_url":"https://api.github.com/users/siminm/events{/privacy}","received_events_url":"https://api.github.com/users/siminm/received_events","type":"User","site_admin":false},"body":"@diranged Not happy with this :( Would appreciate some feedback here.\r\n\r\nI wanted the account name to be printed exactly once, on the first use of *any* rightscale actor. This implementation does it.\r\n\r\nBut then I would have to mock this out in **every single test** :( So what I did is remove the yield here. \r\n\r\nCan't have it in __init__ because it would be synchronous and blocking and I would still have to mock it in every test.","created_at":"2016-04-20T18:55:35Z","updated_at":"2016-04-20T18:55:35Z","html_url":"https://github.com/Nextdoor/kingpin/pull/333#discussion_r60467136","pull_request_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333","_links":{"self":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments/60467136"},"html":{"href":"https://github.com/Nextdoor/kingpin/pull/333#discussion_r60467136"},"pull_request":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333"}}},"pull_request":{"url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333","id":66936927,"html_url":"https://github.com/Nextdoor/kingpin/pull/333","diff_url":"https://github.com/Nextdoor/kingpin/pull/333.diff","patch_url":"https://github.com/Nextdoor/kingpin/pull/333.patch","issue_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/333","number":333,"state":"open","locked":false,"title":"Add mci.Update actor","user":{"login":"siminm","id":3210918,"avatar_url":"https://avatars.githubusercontent.com/u/3210918?v=3","gravatar_id":"","url":"https://api.github.com/users/siminm","html_url":"https://github.com/siminm","followers_url":"https://api.github.com/users/siminm/followers","following_url":"https://api.github.com/users/siminm/following{/other_user}","gists_url":"https://api.github.com/users/siminm/gists{/gist_id}","starred_url":"https://api.github.com/users/siminm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siminm/subscriptions","organizations_url":"https://api.github.com/users/siminm/orgs","repos_url":"https://api.github.com/users/siminm/repos","events_url":"https://api.github.com/users/siminm/events{/privacy}","received_events_url":"https://api.github.com/users/siminm/received_events","type":"User","site_admin":false},"body":"cc @diranged \r\n\r\nJust opening this to keep track of changes. Please do not review this atrocity yet!","created_at":"2016-04-18T23:10:33Z","updated_at":"2016-04-20T18:55:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"798abe3b4a7227ef49c73941587a271598f8ba32","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333/commits","review_comments_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333/comments","review_comment_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/333/comments","statuses_url":"https://api.github.com/repos/Nextdoor/kingpin/statuses/99530917cc7c7fa6c3cc2840e5d70d3171cc39c2","head":{"label":"Nextdoor:mci_update","ref":"mci_update","sha":"99530917cc7c7fa6c3cc2840e5d70d3171cc39c2","user":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"repo":{"id":22902460,"name":"kingpin","full_name":"Nextdoor/kingpin","owner":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nextdoor/kingpin","description":"Deployment Automation Engine","fork":false,"url":"https://api.github.com/repos/Nextdoor/kingpin","forks_url":"https://api.github.com/repos/Nextdoor/kingpin/forks","keys_url":"https://api.github.com/repos/Nextdoor/kingpin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nextdoor/kingpin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nextdoor/kingpin/teams","hooks_url":"https://api.github.com/repos/Nextdoor/kingpin/hooks","issue_events_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/events{/number}","events_url":"https://api.github.com/repos/Nextdoor/kingpin/events","assignees_url":"https://api.github.com/repos/Nextdoor/kingpin/assignees{/user}","branches_url":"https://api.github.com/repos/Nextdoor/kingpin/branches{/branch}","tags_url":"https://api.github.com/repos/Nextdoor/kingpin/tags","blobs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nextdoor/kingpin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nextdoor/kingpin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nextdoor/kingpin/statuses/{sha}","languages_url":"https://api.github.com/repos/Nextdoor/kingpin/languages","stargazers_url":"https://api.github.com/repos/Nextdoor/kingpin/stargazers","contributors_url":"https://api.github.com/repos/Nextdoor/kingpin/contributors","subscribers_url":"https://api.github.com/repos/Nextdoor/kingpin/subscribers","subscription_url":"https://api.github.com/repos/Nextdoor/kingpin/subscription","commits_url":"https://api.github.com/repos/Nextdoor/kingpin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nextdoor/kingpin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nextdoor/kingpin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nextdoor/kingpin/contents/{+path}","compare_url":"https://api.github.com/repos/Nextdoor/kingpin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nextdoor/kingpin/merges","archive_url":"https://api.github.com/repos/Nextdoor/kingpin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nextdoor/kingpin/downloads","issues_url":"https://api.github.com/repos/Nextdoor/kingpin/issues{/number}","pulls_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls{/number}","milestones_url":"https://api.github.com/repos/Nextdoor/kingpin/milestones{/number}","notifications_url":"https://api.github.com/repos/Nextdoor/kingpin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nextdoor/kingpin/labels{/name}","releases_url":"https://api.github.com/repos/Nextdoor/kingpin/releases{/id}","deployments_url":"https://api.github.com/repos/Nextdoor/kingpin/deployments","created_at":"2014-08-13T04:23:40Z","updated_at":"2016-02-12T22:36:22Z","pushed_at":"2016-04-20T17:49:43Z","git_url":"git://github.com/Nextdoor/kingpin.git","ssh_url":"git@github.com:Nextdoor/kingpin.git","clone_url":"https://github.com/Nextdoor/kingpin.git","svn_url":"https://github.com/Nextdoor/kingpin","homepage":"","size":1095,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":28,"forks":4,"open_issues":28,"watchers":7,"default_branch":"master"}},"base":{"label":"Nextdoor:master","ref":"master","sha":"7197834485971208b819ab762df831f7496255ce","user":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"repo":{"id":22902460,"name":"kingpin","full_name":"Nextdoor/kingpin","owner":{"login":"Nextdoor","id":605176,"avatar_url":"https://avatars.githubusercontent.com/u/605176?v=3","gravatar_id":"","url":"https://api.github.com/users/Nextdoor","html_url":"https://github.com/Nextdoor","followers_url":"https://api.github.com/users/Nextdoor/followers","following_url":"https://api.github.com/users/Nextdoor/following{/other_user}","gists_url":"https://api.github.com/users/Nextdoor/gists{/gist_id}","starred_url":"https://api.github.com/users/Nextdoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nextdoor/subscriptions","organizations_url":"https://api.github.com/users/Nextdoor/orgs","repos_url":"https://api.github.com/users/Nextdoor/repos","events_url":"https://api.github.com/users/Nextdoor/events{/privacy}","received_events_url":"https://api.github.com/users/Nextdoor/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Nextdoor/kingpin","description":"Deployment Automation Engine","fork":false,"url":"https://api.github.com/repos/Nextdoor/kingpin","forks_url":"https://api.github.com/repos/Nextdoor/kingpin/forks","keys_url":"https://api.github.com/repos/Nextdoor/kingpin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nextdoor/kingpin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nextdoor/kingpin/teams","hooks_url":"https://api.github.com/repos/Nextdoor/kingpin/hooks","issue_events_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/events{/number}","events_url":"https://api.github.com/repos/Nextdoor/kingpin/events","assignees_url":"https://api.github.com/repos/Nextdoor/kingpin/assignees{/user}","branches_url":"https://api.github.com/repos/Nextdoor/kingpin/branches{/branch}","tags_url":"https://api.github.com/repos/Nextdoor/kingpin/tags","blobs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nextdoor/kingpin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nextdoor/kingpin/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nextdoor/kingpin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nextdoor/kingpin/statuses/{sha}","languages_url":"https://api.github.com/repos/Nextdoor/kingpin/languages","stargazers_url":"https://api.github.com/repos/Nextdoor/kingpin/stargazers","contributors_url":"https://api.github.com/repos/Nextdoor/kingpin/contributors","subscribers_url":"https://api.github.com/repos/Nextdoor/kingpin/subscribers","subscription_url":"https://api.github.com/repos/Nextdoor/kingpin/subscription","commits_url":"https://api.github.com/repos/Nextdoor/kingpin/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nextdoor/kingpin/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nextdoor/kingpin/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nextdoor/kingpin/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nextdoor/kingpin/contents/{+path}","compare_url":"https://api.github.com/repos/Nextdoor/kingpin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nextdoor/kingpin/merges","archive_url":"https://api.github.com/repos/Nextdoor/kingpin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nextdoor/kingpin/downloads","issues_url":"https://api.github.com/repos/Nextdoor/kingpin/issues{/number}","pulls_url":"https://api.github.com/repos/Nextdoor/kingpin/pulls{/number}","milestones_url":"https://api.github.com/repos/Nextdoor/kingpin/milestones{/number}","notifications_url":"https://api.github.com/repos/Nextdoor/kingpin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nextdoor/kingpin/labels{/name}","releases_url":"https://api.github.com/repos/Nextdoor/kingpin/releases{/id}","deployments_url":"https://api.github.com/repos/Nextdoor/kingpin/deployments","created_at":"2014-08-13T04:23:40Z","updated_at":"2016-02-12T22:36:22Z","pushed_at":"2016-04-20T17:49:43Z","git_url":"git://github.com/Nextdoor/kingpin.git","ssh_url":"git@github.com:Nextdoor/kingpin.git","clone_url":"https://github.com/Nextdoor/kingpin.git","svn_url":"https://github.com/Nextdoor/kingpin","homepage":"","size":1095,"stargazers_count":7,"watchers_count":7,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":28,"forks":4,"open_issues":28,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333"},"html":{"href":"https://github.com/Nextdoor/kingpin/pull/333"},"issue":{"href":"https://api.github.com/repos/Nextdoor/kingpin/issues/333"},"comments":{"href":"https://api.github.com/repos/Nextdoor/kingpin/issues/333/comments"},"review_comments":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333/comments"},"review_comment":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nextdoor/kingpin/pulls/333/commits"},"statuses":{"href":"https://api.github.com/repos/Nextdoor/kingpin/statuses/99530917cc7c7fa6c3cc2840e5d70d3171cc39c2"}}}}