Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Allow
sam local invoke
to retrieve account id from current logged in session #7013Allow
sam local invoke
to retrieve account id from current logged in session #7013Changes from 12 commits
61a5c5f
9605545
c7732ac
8ef323f
6a39e1d
fb33fbe
77543bf
fe8ace6
f2ee4a2
8da5919
0c6d025
f412c84
290c556
b3c5831
f046969
c2543ce
3ec9847
6190ad2
40ee4e2
29f539c
e7061b3
5e7c72e
dafa4c8
90bca1a
1740627
35b0a22
74d8852
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this function is ok to error, can you also add a generic exception handling right now? If theres no exception handling here, if an error occurs outside of the 2 defined errors, there is potential for this function to panic the execution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I caatch these two exceptions because they can be the consequences of
~/.aws/credentials
or~/.aws/config
fileIf anything else causes an error, we don't know what's caused it and in my opinion the execution should panic because we don't know how to handle it.
Thoughts? I mean, I'm happy to put in a generic
except
and continue but I'm not sure if that's what we should do hereThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to consider catching the
ClientError
exception here too. Using expired credentials, botocore returns:You had mentioned that other tests start failing once the
ClientError
was caught, maybe we could look at fixing those?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lucashuy What I've done is add catching
ClientError
to the new method, and patching the new method for the existing tests so it's just a stub; they don't need a live connection so inserting a live account ID is irrelevant. All tests are passing nowI also put back in some definitions of
aws_profile
I had taken out of some of those tests. Now the only differences to upstream are the patching of_add_account_id_to_global
and the extra tests for the new code.