Fix an exception handling for LifecyclePolicyNotFoundException
This commit is contained in:
parent
9449cac446
commit
fb3227e265
@ -36,8 +36,11 @@ def ecr_private_lifecycle_policy_configured():
|
|||||||
repositoryName=repository["repositoryName"],
|
repositoryName=repository["repositoryName"],
|
||||||
)
|
)
|
||||||
compliant_resource.append(repository["repositoryArn"])
|
compliant_resource.append(repository["repositoryArn"])
|
||||||
except botocore.errorfactory.LifecyclePolicyNotFoundException:
|
except Exception as e:
|
||||||
|
if e.__class__.__name__ == "LifecyclePolicyNotFoundException":
|
||||||
non_compliant_resources.append(repository["repositoryArn"])
|
non_compliant_resources.append(repository["repositoryArn"])
|
||||||
|
else:
|
||||||
|
raise e
|
||||||
|
|
||||||
return RuleCheckResult(
|
return RuleCheckResult(
|
||||||
passed=not non_compliant_resources,
|
passed=not non_compliant_resources,
|
||||||
|
Loading…
Reference in New Issue
Block a user