{"action":"created","comment":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/52321841","id":52321841,"diff_hunk":"@@ -0,0 +1,25 @@\n+import mock\n+\n+from twisted.python.usage import UsageError\n+\n+from flocker.testtools import TestCase\n+\n+from ..acceptance import CommonOptions\n+from ..cluster_setup import RunOptions\n+\n+\n+class RunOptionsTest(TestCase):\n+\n+    @mock.patch.object(CommonOptions, 'postOptions')","path":"admin/test/test_cluster_setup.py","position":13,"original_position":13,"commit_id":"71db58ea32f9175dcce01ab04554ec24982129a4","original_commit_id":"71db58ea32f9175dcce01ab04554ec24982129a4","user":{"login":"brendan-donegan","id":2405934,"avatar_url":"https://avatars.githubusercontent.com/u/2405934?v=3","gravatar_id":"","url":"https://api.github.com/users/brendan-donegan","html_url":"https://github.com/brendan-donegan","followers_url":"https://api.github.com/users/brendan-donegan/followers","following_url":"https://api.github.com/users/brendan-donegan/following{/other_user}","gists_url":"https://api.github.com/users/brendan-donegan/gists{/gist_id}","starred_url":"https://api.github.com/users/brendan-donegan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendan-donegan/subscriptions","organizations_url":"https://api.github.com/users/brendan-donegan/orgs","repos_url":"https://api.github.com/users/brendan-donegan/repos","events_url":"https://api.github.com/users/brendan-donegan/events{/privacy}","received_events_url":"https://api.github.com/users/brendan-donegan/received_events","type":"User","site_admin":false},"body":"That actually changes the nature of the test, as I'm mocking the postOptions of CommonOptions (the parent) rather than of RunOptions. This requires more code and would rapidly become ugly. I'm willing to change it here for the sake of getting this landed, but I'd question whether it's correct to avoid writing certain kinds of tests in order to avoid adding mock as a dependency.","created_at":"2016-02-09T15:25:20Z","updated_at":"2016-02-09T15:25:20Z","html_url":"https://github.com/ClusterHQ/flocker/pull/2622#discussion_r52321841","pull_request_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622","_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments/52321841"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2622#discussion_r52321841"},"pull_request":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622"}}},"pull_request":{"url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622","id":58758373,"html_url":"https://github.com/ClusterHQ/flocker/pull/2622","diff_url":"https://github.com/ClusterHQ/flocker/pull/2622.diff","patch_url":"https://github.com/ClusterHQ/flocker/pull/2622.patch","issue_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2622","number":2622,"state":"open","locked":false,"title":"Patch cluster management scripts to use eliot_to_stdout","user":{"login":"brendan-donegan","id":2405934,"avatar_url":"https://avatars.githubusercontent.com/u/2405934?v=3","gravatar_id":"","url":"https://api.github.com/users/brendan-donegan","html_url":"https://github.com/brendan-donegan","followers_url":"https://api.github.com/users/brendan-donegan/followers","following_url":"https://api.github.com/users/brendan-donegan/following{/other_user}","gists_url":"https://api.github.com/users/brendan-donegan/gists{/gist_id}","starred_url":"https://api.github.com/users/brendan-donegan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendan-donegan/subscriptions","organizations_url":"https://api.github.com/users/brendan-donegan/orgs","repos_url":"https://api.github.com/users/brendan-donegan/repos","events_url":"https://api.github.com/users/brendan-donegan/events{/privacy}","received_events_url":"https://api.github.com/users/brendan-donegan/received_events","type":"User","site_admin":false},"body":"eliot_to_stdout moved and it's usage in e.g. cluster_setup.py wasn't caught as there were no tests of any kind for that. This PR:\r\n\r\n- Updates cluster_setup.py and cluster_add_nodes.py to use eliot_to_stdout (via a convenience function)\r\n- Patches eliot_to_stdout to be less verbose when used in the cluster scripts (this was done on the advice of dwgebler)\r\n- Added a basic test for the options parsing. Note that I chose to introduce use of mock in order to get around the fact that the option parser was embedding quite a lot of logic to connect to the cloud provider.","created_at":"2016-02-09T15:00:29Z","updated_at":"2016-02-09T15:25:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"86aecc9efc1e5a9e558da3c188f82c7d79e48f92","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622/commits","review_comments_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622/comments","review_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/2622/comments","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/71db58ea32f9175dcce01ab04554ec24982129a4","head":{"label":"ClusterHQ:FLOC-4124-acceptance-eliot-to-stdout","ref":"FLOC-4124-acceptance-eliot-to-stdout","sha":"71db58ea32f9175dcce01ab04554ec24982129a4","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","deployments_url":"https://api.github.com/repos/ClusterHQ/flocker/deployments","created_at":"2014-04-28T18:02:14Z","updated_at":"2016-02-08T22:56:32Z","pushed_at":"2016-02-09T15:08:05Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":58002,"stargazers_count":2136,"watchers_count":2136,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":155,"mirror_url":null,"open_issues_count":57,"forks":155,"open_issues":57,"watchers":2136,"default_branch":"master"}},"base":{"label":"ClusterHQ:master","ref":"master","sha":"ece5aab408d4df2c8d25996724fd49bc96288de4","user":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"repo":{"id":19248542,"name":"flocker","full_name":"ClusterHQ/flocker","owner":{"login":"ClusterHQ","id":7913449,"avatar_url":"https://avatars.githubusercontent.com/u/7913449?v=3","gravatar_id":"","url":"https://api.github.com/users/ClusterHQ","html_url":"https://github.com/ClusterHQ","followers_url":"https://api.github.com/users/ClusterHQ/followers","following_url":"https://api.github.com/users/ClusterHQ/following{/other_user}","gists_url":"https://api.github.com/users/ClusterHQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ClusterHQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ClusterHQ/subscriptions","organizations_url":"https://api.github.com/users/ClusterHQ/orgs","repos_url":"https://api.github.com/users/ClusterHQ/repos","events_url":"https://api.github.com/users/ClusterHQ/events{/privacy}","received_events_url":"https://api.github.com/users/ClusterHQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ClusterHQ/flocker","description":"Container data volume manager for your Dockerized application","fork":false,"url":"https://api.github.com/repos/ClusterHQ/flocker","forks_url":"https://api.github.com/repos/ClusterHQ/flocker/forks","keys_url":"https://api.github.com/repos/ClusterHQ/flocker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ClusterHQ/flocker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ClusterHQ/flocker/teams","hooks_url":"https://api.github.com/repos/ClusterHQ/flocker/hooks","issue_events_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/events{/number}","events_url":"https://api.github.com/repos/ClusterHQ/flocker/events","assignees_url":"https://api.github.com/repos/ClusterHQ/flocker/assignees{/user}","branches_url":"https://api.github.com/repos/ClusterHQ/flocker/branches{/branch}","tags_url":"https://api.github.com/repos/ClusterHQ/flocker/tags","blobs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ClusterHQ/flocker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ClusterHQ/flocker/git/refs{/sha}","trees_url":"https://api.github.com/repos/ClusterHQ/flocker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ClusterHQ/flocker/statuses/{sha}","languages_url":"https://api.github.com/repos/ClusterHQ/flocker/languages","stargazers_url":"https://api.github.com/repos/ClusterHQ/flocker/stargazers","contributors_url":"https://api.github.com/repos/ClusterHQ/flocker/contributors","subscribers_url":"https://api.github.com/repos/ClusterHQ/flocker/subscribers","subscription_url":"https://api.github.com/repos/ClusterHQ/flocker/subscription","commits_url":"https://api.github.com/repos/ClusterHQ/flocker/commits{/sha}","git_commits_url":"https://api.github.com/repos/ClusterHQ/flocker/git/commits{/sha}","comments_url":"https://api.github.com/repos/ClusterHQ/flocker/comments{/number}","issue_comment_url":"https://api.github.com/repos/ClusterHQ/flocker/issues/comments{/number}","contents_url":"https://api.github.com/repos/ClusterHQ/flocker/contents/{+path}","compare_url":"https://api.github.com/repos/ClusterHQ/flocker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ClusterHQ/flocker/merges","archive_url":"https://api.github.com/repos/ClusterHQ/flocker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ClusterHQ/flocker/downloads","issues_url":"https://api.github.com/repos/ClusterHQ/flocker/issues{/number}","pulls_url":"https://api.github.com/repos/ClusterHQ/flocker/pulls{/number}","milestones_url":"https://api.github.com/repos/ClusterHQ/flocker/milestones{/number}","notifications_url":"https://api.github.com/repos/ClusterHQ/flocker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ClusterHQ/flocker/labels{/name}","releases_url":"https://api.github.com/repos/ClusterHQ/flocker/releases{/id}","deployments_url":"https://api.github.com/repos/ClusterHQ/flocker/deployments","created_at":"2014-04-28T18:02:14Z","updated_at":"2016-02-08T22:56:32Z","pushed_at":"2016-02-09T15:08:05Z","git_url":"git://github.com/ClusterHQ/flocker.git","ssh_url":"git@github.com:ClusterHQ/flocker.git","clone_url":"https://github.com/ClusterHQ/flocker.git","svn_url":"https://github.com/ClusterHQ/flocker","homepage":"https://clusterhq.com","size":58002,"stargazers_count":2136,"watchers_count":2136,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":155,"mirror_url":null,"open_issues_count":57,"forks":155,"open_issues":57,"watchers":2136,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622"},"html":{"href":"https://github.com/ClusterHQ/flocker/pull/2622"},"issue":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2622"},"comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/issues/2622/comments"},"review_comments":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622/comments"},"review_comment":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ClusterHQ/flocker/pulls/2622/commits"},"statuses":{"href":"https://api.github.com/repos/ClusterHQ/flocker/statuses/71db58ea32f9175dcce01ab04554ec24982129a4"}}}}