Skip to content

Commit

Permalink
Fixes snapshot fetching InvalidParameterValue bug
Browse files Browse the repository at this point in the history
It looks like the InvalidParameterValue bug (lyft#825) is still present after lyft#822. This adds an exception for error
  • Loading branch information
Rickerd0613 committed Apr 27, 2022
1 parent b9127be commit 6484034
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cartography/intel/aws/ec2/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_snapshots(boto3_session: boto3.session.Session, region: str, in_use_snap
for page in paginator.paginate(SnapshotIds=list(other_snapshot_ids)):
snapshots.extend(page['Snapshots'])
except ClientError as e:
if e.response['Error']['Code'] == 'InvalidSnapshot.NotFound':
if (e.response['Error']['Code'] == 'InvalidSnapshot.NotFound' or e.response['Error']['Code'] == 'InvalidParameterValue'):
logger.warning(f"Failed to retrieve page of in-use, \
not owned snapshots. Continuing anyway. Error - {e}")
else:
Expand Down

0 comments on commit 6484034

Please sign in to comment.