Skip to content

Commit

Permalink
Fix failing tests by using .get() for 'account_id' and removing it fr…
Browse files Browse the repository at this point in the history
…om expected_keys list
  • Loading branch information
alexgromero committed Jan 3, 2025
1 parent ea2eb48 commit e8b7d8a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions botocore/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def create_from_metadata(
expiry_time=cls._expiry_datetime(metadata['expiry_time']),
method=method,
refresh_using=refresh_using,
account_id=metadata['account_id'],
account_id=metadata.get('account_id'),
**kwargs,
)
return instance
Expand Down Expand Up @@ -601,7 +601,6 @@ def _set_from_data(self, data):
'secret_key',
'token',
'expiry_time',
'account_id',
]
if not data:
missing_keys = expected_keys
Expand All @@ -619,7 +618,7 @@ def _set_from_data(self, data):
self.secret_key = data['secret_key']
self.token = data['token']
self._expiry_time = parse(data['expiry_time'])
self.account_id = data['account_id']
self.account_id = data.get('account_id')
logger.debug(
"Retrieved credentials will expire at: %s", self._expiry_time
)
Expand Down

0 comments on commit e8b7d8a

Please sign in to comment.