{"action":"created","comment":{"url":"https://api.github.com/repos/juju/juju/pulls/comments/235848924","pull_request_review_id":177810159,"id":235848924,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTg0ODkyNA==","diff_hunk":"@@ -176,23 +192,72 @@ func (c *statusCommand) Init(args []string) error {\n }\n \n var newAPIClientForStatus = func(c *statusCommand) (statusAPI, error) {\n-\tif c.api != nil {\n-\t\treturn c.api, nil\n+\tif c.statusAPI == nil {\n+\t\tapi, err := c.NewAPIClient()\n+\t\tif err != nil {\n+\t\t\treturn nil, errors.Trace(err)\n+\t\t}\n+\t\tc.statusAPI = api\n+\t}\n+\treturn c.statusAPI, nil\n+}\n+\n+var newAPIClientForStorage = func(c *statusCommand) (storage.StorageListAPI, error) {\n+\tif c.storageAPI == nil {\n+\t\troot, err := c.NewAPIRoot()\n+\t\tif err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t\tc.storageAPI = storageapi.NewClient(root)\n \t}\n-\treturn c.NewAPIClient()\n+\treturn c.storageAPI, nil\n+}\n+\n+func (c *statusCommand) close() (err error) {","path":"cmd/juju/status/status.go","position":134,"original_position":134,"commit_id":"460edaa26830b42c33bd76564011a0387907a14a","original_commit_id":"99c685e96075bf0bc40dee8a7a6ebfe64a5b1986","user":{"login":"wallyworld","id":5808968,"node_id":"MDQ6VXNlcjU4MDg5Njg=","avatar_url":"https://avatars3.githubusercontent.com/u/5808968?v=4","gravatar_id":"","url":"https://api.github.com/users/wallyworld","html_url":"https://github.com/wallyworld","followers_url":"https://api.github.com/users/wallyworld/followers","following_url":"https://api.github.com/users/wallyworld/following{/other_user}","gists_url":"https://api.github.com/users/wallyworld/gists{/gist_id}","starred_url":"https://api.github.com/users/wallyworld/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wallyworld/subscriptions","organizations_url":"https://api.github.com/users/wallyworld/orgs","repos_url":"https://api.github.com/users/wallyworld/repos","events_url":"https://api.github.com/users/wallyworld/events{/privacy}","received_events_url":"https://api.github.com/users/wallyworld/received_events","type":"User","site_admin":false},"body":"This isn't right - regardless of where the api came from, we close it. Just use a defer inside Run()","created_at":"2018-11-23T05:23:56Z","updated_at":"2018-11-23T05:36:47Z","html_url":"https://github.com/juju/juju/pull/9490#discussion_r235848924","pull_request_url":"https://api.github.com/repos/juju/juju/pulls/9490","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/comments/235848924"},"html":{"href":"https://github.com/juju/juju/pull/9490#discussion_r235848924"},"pull_request":{"href":"https://api.github.com/repos/juju/juju/pulls/9490"}}},"pull_request":{"url":"https://api.github.com/repos/juju/juju/pulls/9490","id":232556900,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyNTU2OTAw","html_url":"https://github.com/juju/juju/pull/9490","diff_url":"https://github.com/juju/juju/pull/9490.diff","patch_url":"https://github.com/juju/juju/pull/9490.patch","issue_url":"https://api.github.com/repos/juju/juju/issues/9490","number":9490,"state":"open","locked":false,"title":"Feature/add storage data to juju status","user":{"login":"ycliuhw","id":6562925,"node_id":"MDQ6VXNlcjY1NjI5MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/6562925?v=4","gravatar_id":"","url":"https://api.github.com/users/ycliuhw","html_url":"https://github.com/ycliuhw","followers_url":"https://api.github.com/users/ycliuhw/followers","following_url":"https://api.github.com/users/ycliuhw/following{/other_user}","gists_url":"https://api.github.com/users/ycliuhw/gists{/gist_id}","starred_url":"https://api.github.com/users/ycliuhw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycliuhw/subscriptions","organizations_url":"https://api.github.com/users/ycliuhw/orgs","repos_url":"https://api.github.com/users/ycliuhw/repos","events_url":"https://api.github.com/users/ycliuhw/events{/privacy}","received_events_url":"https://api.github.com/users/ycliuhw/received_events","type":"User","site_admin":false},"body":"## Description of change\r\n\r\nintroduce storage information to status cmd;\r\n\r\n## QA steps\r\n\r\n1. deploy some workloads with storage;\r\n2. `juju status --storage  -m <model-name>`;\r\n3. `juju status --format json -m <model-name> | python -m json.tool`;\r\n4. `juju status --format yaml -m <model-name> `;\r\n\r\n## Documentation changes\r\n\r\nYes.\r\n\r\n## Bug reference\r\n\r\nhttps://bugs.launchpad.net/juju/+bug/1734287\r\n","created_at":"2018-11-21T06:55:23Z","updated_at":"2018-11-23T05:36:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"06372c8ba17478e3aa937fed70f1d22f3462f59c","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/juju/juju/pulls/9490/commits","review_comments_url":"https://api.github.com/repos/juju/juju/pulls/9490/comments","review_comment_url":"https://api.github.com/repos/juju/juju/pulls/comments{/number}","comments_url":"https://api.github.com/repos/juju/juju/issues/9490/comments","statuses_url":"https://api.github.com/repos/juju/juju/statuses/460edaa26830b42c33bd76564011a0387907a14a","head":{"label":"ycliuhw:feature/add-storage-data-to-juju-status","ref":"feature/add-storage-data-to-juju-status","sha":"460edaa26830b42c33bd76564011a0387907a14a","user":{"login":"ycliuhw","id":6562925,"node_id":"MDQ6VXNlcjY1NjI5MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/6562925?v=4","gravatar_id":"","url":"https://api.github.com/users/ycliuhw","html_url":"https://github.com/ycliuhw","followers_url":"https://api.github.com/users/ycliuhw/followers","following_url":"https://api.github.com/users/ycliuhw/following{/other_user}","gists_url":"https://api.github.com/users/ycliuhw/gists{/gist_id}","starred_url":"https://api.github.com/users/ycliuhw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycliuhw/subscriptions","organizations_url":"https://api.github.com/users/ycliuhw/orgs","repos_url":"https://api.github.com/users/ycliuhw/repos","events_url":"https://api.github.com/users/ycliuhw/events{/privacy}","received_events_url":"https://api.github.com/users/ycliuhw/received_events","type":"User","site_admin":false},"repo":{"id":129208625,"node_id":"MDEwOlJlcG9zaXRvcnkxMjkyMDg2MjU=","name":"juju","full_name":"ycliuhw/juju","private":false,"owner":{"login":"ycliuhw","id":6562925,"node_id":"MDQ6VXNlcjY1NjI5MjU=","avatar_url":"https://avatars3.githubusercontent.com/u/6562925?v=4","gravatar_id":"","url":"https://api.github.com/users/ycliuhw","html_url":"https://github.com/ycliuhw","followers_url":"https://api.github.com/users/ycliuhw/followers","following_url":"https://api.github.com/users/ycliuhw/following{/other_user}","gists_url":"https://api.github.com/users/ycliuhw/gists{/gist_id}","starred_url":"https://api.github.com/users/ycliuhw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ycliuhw/subscriptions","organizations_url":"https://api.github.com/users/ycliuhw/orgs","repos_url":"https://api.github.com/users/ycliuhw/repos","events_url":"https://api.github.com/users/ycliuhw/events{/privacy}","received_events_url":"https://api.github.com/users/ycliuhw/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ycliuhw/juju","description":"juju is devops distilled","fork":true,"url":"https://api.github.com/repos/ycliuhw/juju","forks_url":"https://api.github.com/repos/ycliuhw/juju/forks","keys_url":"https://api.github.com/repos/ycliuhw/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ycliuhw/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ycliuhw/juju/teams","hooks_url":"https://api.github.com/repos/ycliuhw/juju/hooks","issue_events_url":"https://api.github.com/repos/ycliuhw/juju/issues/events{/number}","events_url":"https://api.github.com/repos/ycliuhw/juju/events","assignees_url":"https://api.github.com/repos/ycliuhw/juju/assignees{/user}","branches_url":"https://api.github.com/repos/ycliuhw/juju/branches{/branch}","tags_url":"https://api.github.com/repos/ycliuhw/juju/tags","blobs_url":"https://api.github.com/repos/ycliuhw/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ycliuhw/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ycliuhw/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/ycliuhw/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ycliuhw/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/ycliuhw/juju/languages","stargazers_url":"https://api.github.com/repos/ycliuhw/juju/stargazers","contributors_url":"https://api.github.com/repos/ycliuhw/juju/contributors","subscribers_url":"https://api.github.com/repos/ycliuhw/juju/subscribers","subscription_url":"https://api.github.com/repos/ycliuhw/juju/subscription","commits_url":"https://api.github.com/repos/ycliuhw/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/ycliuhw/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/ycliuhw/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/ycliuhw/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/ycliuhw/juju/contents/{+path}","compare_url":"https://api.github.com/repos/ycliuhw/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ycliuhw/juju/merges","archive_url":"https://api.github.com/repos/ycliuhw/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ycliuhw/juju/downloads","issues_url":"https://api.github.com/repos/ycliuhw/juju/issues{/number}","pulls_url":"https://api.github.com/repos/ycliuhw/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/ycliuhw/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/ycliuhw/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ycliuhw/juju/labels{/name}","releases_url":"https://api.github.com/repos/ycliuhw/juju/releases{/id}","deployments_url":"https://api.github.com/repos/ycliuhw/juju/deployments","created_at":"2018-04-12T07:09:20Z","updated_at":"2018-11-15T23:17:46Z","pushed_at":"2018-11-23T05:14:10Z","git_url":"git://github.com/ycliuhw/juju.git","ssh_url":"git@github.com:ycliuhw/juju.git","clone_url":"https://github.com/ycliuhw/juju.git","svn_url":"https://github.com/ycliuhw/juju","homepage":"juju.ubuntu.com","size":231983,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"juju:develop","ref":"develop","sha":"62ab7117ac55789df452771d6b40520d6b3c7c6a","user":{"login":"juju","id":4604548,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDQ1NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"repo":{"id":20445947,"node_id":"MDEwOlJlcG9zaXRvcnkyMDQ0NTk0Nw==","name":"juju","full_name":"juju/juju","private":false,"owner":{"login":"juju","id":4604548,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ2MDQ1NDg=","avatar_url":"https://avatars0.githubusercontent.com/u/4604548?v=4","gravatar_id":"","url":"https://api.github.com/users/juju","html_url":"https://github.com/juju","followers_url":"https://api.github.com/users/juju/followers","following_url":"https://api.github.com/users/juju/following{/other_user}","gists_url":"https://api.github.com/users/juju/gists{/gist_id}","starred_url":"https://api.github.com/users/juju/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juju/subscriptions","organizations_url":"https://api.github.com/users/juju/orgs","repos_url":"https://api.github.com/users/juju/repos","events_url":"https://api.github.com/users/juju/events{/privacy}","received_events_url":"https://api.github.com/users/juju/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/juju/juju","description":"juju is devops distilled","fork":false,"url":"https://api.github.com/repos/juju/juju","forks_url":"https://api.github.com/repos/juju/juju/forks","keys_url":"https://api.github.com/repos/juju/juju/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juju/juju/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juju/juju/teams","hooks_url":"https://api.github.com/repos/juju/juju/hooks","issue_events_url":"https://api.github.com/repos/juju/juju/issues/events{/number}","events_url":"https://api.github.com/repos/juju/juju/events","assignees_url":"https://api.github.com/repos/juju/juju/assignees{/user}","branches_url":"https://api.github.com/repos/juju/juju/branches{/branch}","tags_url":"https://api.github.com/repos/juju/juju/tags","blobs_url":"https://api.github.com/repos/juju/juju/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juju/juju/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juju/juju/git/refs{/sha}","trees_url":"https://api.github.com/repos/juju/juju/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juju/juju/statuses/{sha}","languages_url":"https://api.github.com/repos/juju/juju/languages","stargazers_url":"https://api.github.com/repos/juju/juju/stargazers","contributors_url":"https://api.github.com/repos/juju/juju/contributors","subscribers_url":"https://api.github.com/repos/juju/juju/subscribers","subscription_url":"https://api.github.com/repos/juju/juju/subscription","commits_url":"https://api.github.com/repos/juju/juju/commits{/sha}","git_commits_url":"https://api.github.com/repos/juju/juju/git/commits{/sha}","comments_url":"https://api.github.com/repos/juju/juju/comments{/number}","issue_comment_url":"https://api.github.com/repos/juju/juju/issues/comments{/number}","contents_url":"https://api.github.com/repos/juju/juju/contents/{+path}","compare_url":"https://api.github.com/repos/juju/juju/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juju/juju/merges","archive_url":"https://api.github.com/repos/juju/juju/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juju/juju/downloads","issues_url":"https://api.github.com/repos/juju/juju/issues{/number}","pulls_url":"https://api.github.com/repos/juju/juju/pulls{/number}","milestones_url":"https://api.github.com/repos/juju/juju/milestones{/number}","notifications_url":"https://api.github.com/repos/juju/juju/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juju/juju/labels{/name}","releases_url":"https://api.github.com/repos/juju/juju/releases{/id}","deployments_url":"https://api.github.com/repos/juju/juju/deployments","created_at":"2014-06-03T14:28:10Z","updated_at":"2018-11-21T20:27:10Z","pushed_at":"2018-11-23T05:14:11Z","git_url":"git://github.com/juju/juju.git","ssh_url":"git@github.com:juju/juju.git","clone_url":"https://github.com/juju/juju.git","svn_url":"https://github.com/juju/juju","homepage":"juju.ubuntu.com","size":231821,"stargazers_count":1272,"watchers_count":1272,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":295,"mirror_url":null,"archived":false,"open_issues_count":12,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0","node_id":"MDc6TGljZW5zZTE="},"forks":295,"open_issues":12,"watchers":1272,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/juju/juju/pulls/9490"},"html":{"href":"https://github.com/juju/juju/pull/9490"},"issue":{"href":"https://api.github.com/repos/juju/juju/issues/9490"},"comments":{"href":"https://api.github.com/repos/juju/juju/issues/9490/comments"},"review_comments":{"href":"https://api.github.com/repos/juju/juju/pulls/9490/comments"},"review_comment":{"href":"https://api.github.com/repos/juju/juju/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/juju/juju/pulls/9490/commits"},"statuses":{"href":"https://api.github.com/repos/juju/juju/statuses/460edaa26830b42c33bd76564011a0387907a14a"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"wallyworld"}}