{"action":"created","comment":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments/53834725","id":53834725,"diff_hunk":"@@ -60,8 +60,9 @@ def _main():\n     if dcoscli.version != 'SNAPSHOT' and command and command != \"config\":\n         try:\n             cluster_id = mesos.DCOSClient().metadata().get('CLUSTER_ID')\n-        except DCOSException:\n-            raise\n+        except DCOSException as e:\n+            if \"Authentication failed\" in str(e):","path":"cli/dcoscli/main.py","position":7,"original_position":7,"commit_id":"2fa6b623f61b3e655aa8f30c0be0868b6ae53dda","original_commit_id":"2fa6b623f61b3e655aa8f30c0be0868b6ae53dda","user":{"login":"tamarrow","id":1292768,"avatar_url":"https://avatars.githubusercontent.com/u/1292768?v=3","gravatar_id":"","url":"https://api.github.com/users/tamarrow","html_url":"https://github.com/tamarrow","followers_url":"https://api.github.com/users/tamarrow/followers","following_url":"https://api.github.com/users/tamarrow/following{/other_user}","gists_url":"https://api.github.com/users/tamarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tamarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamarrow/subscriptions","organizations_url":"https://api.github.com/users/tamarrow/orgs","repos_url":"https://api.github.com/users/tamarrow/repos","events_url":"https://api.github.com/users/tamarrow/events{/privacy}","received_events_url":"https://api.github.com/users/tamarrow/received_events","type":"User","site_admin":false},"body":"no, we want to throw the 401 (Authenticated failed) error, but not the 403 error, because that could be valid in the user specified command. I'll add `DCOSAuthException` so that the code is more readable","created_at":"2016-02-23T19:25:29Z","updated_at":"2016-02-23T19:25:29Z","html_url":"https://github.com/mesosphere/dcos-cli/pull/487#discussion_r53834725","pull_request_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487","_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments/53834725"},"html":{"href":"https://github.com/mesosphere/dcos-cli/pull/487#discussion_r53834725"},"pull_request":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487"}}},"pull_request":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487","id":60274019,"html_url":"https://github.com/mesosphere/dcos-cli/pull/487","diff_url":"https://github.com/mesosphere/dcos-cli/pull/487.diff","patch_url":"https://github.com/mesosphere/dcos-cli/pull/487.patch","issue_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/487","number":487,"state":"open","locked":false,"title":"error based on user command auth not auth to get CLUSTER_ID","user":{"login":"tamarrow","id":1292768,"avatar_url":"https://avatars.githubusercontent.com/u/1292768?v=3","gravatar_id":"","url":"https://api.github.com/users/tamarrow","html_url":"https://github.com/tamarrow","followers_url":"https://api.github.com/users/tamarrow/followers","following_url":"https://api.github.com/users/tamarrow/following{/other_user}","gists_url":"https://api.github.com/users/tamarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tamarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamarrow/subscriptions","organizations_url":"https://api.github.com/users/tamarrow/orgs","repos_url":"https://api.github.com/users/tamarrow/repos","events_url":"https://api.github.com/users/tamarrow/events{/privacy}","received_events_url":"https://api.github.com/users/tamarrow/received_events","type":"User","site_admin":false},"body":"We try to get the CLUSTER_ID before we run the user specified command.\r\nIf the user if authenticated, but not authorized (to get the\r\nCLUSTER_ID), let them continue and error based on access to the command\r\nthey ran.","created_at":"2016-02-23T01:45:53Z","updated_at":"2016-02-23T19:25:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efa1f6ffe5511a41246f35dbb64166af4f819e89","assignee":{"login":"jsancio","id":794394,"avatar_url":"https://avatars.githubusercontent.com/u/794394?v=3","gravatar_id":"","url":"https://api.github.com/users/jsancio","html_url":"https://github.com/jsancio","followers_url":"https://api.github.com/users/jsancio/followers","following_url":"https://api.github.com/users/jsancio/following{/other_user}","gists_url":"https://api.github.com/users/jsancio/gists{/gist_id}","starred_url":"https://api.github.com/users/jsancio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jsancio/subscriptions","organizations_url":"https://api.github.com/users/jsancio/orgs","repos_url":"https://api.github.com/users/jsancio/repos","events_url":"https://api.github.com/users/jsancio/events{/privacy}","received_events_url":"https://api.github.com/users/jsancio/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones/6","html_url":"https://github.com/mesosphere/dcos-cli/milestones/0.3.5","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones/6/labels","id":1598824,"number":6,"title":"0.3.5","description":null,"creator":{"login":"tamarrow","id":1292768,"avatar_url":"https://avatars.githubusercontent.com/u/1292768?v=3","gravatar_id":"","url":"https://api.github.com/users/tamarrow","html_url":"https://github.com/tamarrow","followers_url":"https://api.github.com/users/tamarrow/followers","following_url":"https://api.github.com/users/tamarrow/following{/other_user}","gists_url":"https://api.github.com/users/tamarrow/gists{/gist_id}","starred_url":"https://api.github.com/users/tamarrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamarrow/subscriptions","organizations_url":"https://api.github.com/users/tamarrow/orgs","repos_url":"https://api.github.com/users/tamarrow/repos","events_url":"https://api.github.com/users/tamarrow/events{/privacy}","received_events_url":"https://api.github.com/users/tamarrow/received_events","type":"User","site_admin":false},"open_issues":1,"closed_issues":0,"state":"open","created_at":"2016-02-23T01:46:39Z","updated_at":"2016-02-23T01:46:39Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487/commits","review_comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487/comments","review_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/487/comments","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/2fa6b623f61b3e655aa8f30c0be0868b6ae53dda","head":{"label":"mesosphere:auth-bug","ref":"auth-bug","sha":"2fa6b623f61b3e655aa8f30c0be0868b6ae53dda","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":26653348,"name":"dcos-cli","full_name":"mesosphere/dcos-cli","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-cli","description":"The command line for your datacenter! ","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-cli","forks_url":"https://api.github.com/repos/mesosphere/dcos-cli/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-cli/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-cli/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-cli/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-cli/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-cli/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-cli/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-cli/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-cli/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-cli/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-cli/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-cli/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-cli/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-cli/deployments","created_at":"2014-11-14T19:11:48Z","updated_at":"2016-02-20T13:58:43Z","pushed_at":"2016-02-23T02:22:17Z","git_url":"git://github.com/mesosphere/dcos-cli.git","ssh_url":"git@github.com:mesosphere/dcos-cli.git","clone_url":"https://github.com/mesosphere/dcos-cli.git","svn_url":"https://github.com/mesosphere/dcos-cli","homepage":"http://docs.mesosphere.com/using/cli/","size":2386,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":20,"forks":26,"open_issues":20,"watchers":72,"default_branch":"master"}},"base":{"label":"mesosphere:master","ref":"master","sha":"ff45e211e93f20f88549935df8dfb206f9981fb8","user":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":26653348,"name":"dcos-cli","full_name":"mesosphere/dcos-cli","owner":{"login":"mesosphere","id":3458585,"avatar_url":"https://avatars.githubusercontent.com/u/3458585?v=3","gravatar_id":"","url":"https://api.github.com/users/mesosphere","html_url":"https://github.com/mesosphere","followers_url":"https://api.github.com/users/mesosphere/followers","following_url":"https://api.github.com/users/mesosphere/following{/other_user}","gists_url":"https://api.github.com/users/mesosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/mesosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mesosphere/subscriptions","organizations_url":"https://api.github.com/users/mesosphere/orgs","repos_url":"https://api.github.com/users/mesosphere/repos","events_url":"https://api.github.com/users/mesosphere/events{/privacy}","received_events_url":"https://api.github.com/users/mesosphere/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mesosphere/dcos-cli","description":"The command line for your datacenter! ","fork":false,"url":"https://api.github.com/repos/mesosphere/dcos-cli","forks_url":"https://api.github.com/repos/mesosphere/dcos-cli/forks","keys_url":"https://api.github.com/repos/mesosphere/dcos-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mesosphere/dcos-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mesosphere/dcos-cli/teams","hooks_url":"https://api.github.com/repos/mesosphere/dcos-cli/hooks","issue_events_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/events{/number}","events_url":"https://api.github.com/repos/mesosphere/dcos-cli/events","assignees_url":"https://api.github.com/repos/mesosphere/dcos-cli/assignees{/user}","branches_url":"https://api.github.com/repos/mesosphere/dcos-cli/branches{/branch}","tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/tags","blobs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/mesosphere/dcos-cli/languages","stargazers_url":"https://api.github.com/repos/mesosphere/dcos-cli/stargazers","contributors_url":"https://api.github.com/repos/mesosphere/dcos-cli/contributors","subscribers_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscribers","subscription_url":"https://api.github.com/repos/mesosphere/dcos-cli/subscription","commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/mesosphere/dcos-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/mesosphere/dcos-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/mesosphere/dcos-cli/contents/{+path}","compare_url":"https://api.github.com/repos/mesosphere/dcos-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mesosphere/dcos-cli/merges","archive_url":"https://api.github.com/repos/mesosphere/dcos-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mesosphere/dcos-cli/downloads","issues_url":"https://api.github.com/repos/mesosphere/dcos-cli/issues{/number}","pulls_url":"https://api.github.com/repos/mesosphere/dcos-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/mesosphere/dcos-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/mesosphere/dcos-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mesosphere/dcos-cli/labels{/name}","releases_url":"https://api.github.com/repos/mesosphere/dcos-cli/releases{/id}","deployments_url":"https://api.github.com/repos/mesosphere/dcos-cli/deployments","created_at":"2014-11-14T19:11:48Z","updated_at":"2016-02-20T13:58:43Z","pushed_at":"2016-02-23T02:22:17Z","git_url":"git://github.com/mesosphere/dcos-cli.git","ssh_url":"git@github.com:mesosphere/dcos-cli.git","clone_url":"https://github.com/mesosphere/dcos-cli.git","svn_url":"https://github.com/mesosphere/dcos-cli","homepage":"http://docs.mesosphere.com/using/cli/","size":2386,"stargazers_count":72,"watchers_count":72,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":20,"forks":26,"open_issues":20,"watchers":72,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487"},"html":{"href":"https://github.com/mesosphere/dcos-cli/pull/487"},"issue":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/issues/487"},"comments":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/issues/487/comments"},"review_comments":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487/comments"},"review_comment":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/pulls/487/commits"},"statuses":{"href":"https://api.github.com/repos/mesosphere/dcos-cli/statuses/2fa6b623f61b3e655aa8f30c0be0868b6ae53dda"}}}}