Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle ClientError with code AccessDenied #245

Merged
merged 2 commits into from
Jun 22, 2016

Conversation

kenden
Copy link
Contributor

@kenden kenden commented Jun 21, 2016

it is now handled the same as a NoCredentialsError Exception.

ClientError with code AccessDenied can happen when switching to another AWS role
(with aws sts assume-role --role-arn... for example).
If the token returned from that command expired, we get an accessdenied.

Small refactor to avoid code duplication.

it is now handled the same as a NoCredentialsError Exception.

Small refactor to avoid code duplication (it's a code smell)
@coveralls
Copy link

coveralls commented Jun 21, 2016

Coverage Status

Coverage increased (+0.02%) to 86.558% when pulling 5af84d9 on kenden:handle_access_denied into 2ab6fd9 on zalando-stups:master.

@jmcs
Copy link
Member

jmcs commented Jun 21, 2016

👍

In die_unknown_error(), the error was sent to stdout. Now to stderr.

Moved the tests:
 - test_missing_credentials
 - test_expired_credentials
 from test_cli to test_error_handling

Added testcase in test_missing_credentials().
Added test_unknow_ClientError_no_stack_trace()
@kenden
Copy link
Contributor Author

kenden commented Jun 21, 2016

Thanks for checking @jmcs.
Could you maybe take take a second look?
I added 2 tests and moved a couple around.
Also, I'm not too sure how to tests the cases when stacktrace_visible == True
(the red lines in https://coveralls.io/jobs/15622093/source_files/748665657)

@jmcs
Copy link
Member

jmcs commented Jun 22, 2016

👍

@jmcs jmcs merged commit 0a747a4 into zalando-stups:master Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants