Skip to content

Commit

Permalink
Fixed a bug with the way an exception was being caught.
Browse files Browse the repository at this point in the history
  • Loading branch information
kcantrel committed Jul 25, 2024
1 parent 6325cf4 commit 717f8f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Management-Utilities/fsxn-rotate-secret/fsxn_rotate_secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# region: The region in which the FSx file system is located.
################################################################################

import botocore
import boto3
import logging
import os
Expand Down Expand Up @@ -59,11 +60,11 @@ def set_secret(secretsClient, arn, token):

try:
secretValueResponse = secretsClient.get_secret_value(SecretId=arn, VersionStage="AWSPENDING", VersionId=token)
except ClientError as e:
except botocore.exceptions.ClientError as e:
logger.error(f"Unable to retrieve secret for {arn} in VersionStage = 'AWSPENDING'. Error={e}")
#
# Pass the exception on so the Secret Manager will know that the rotate failed.
raise Exception(e)
raise e

password = secretValueResponse['SecretString']
#
Expand Down

0 comments on commit 717f8f2

Please sign in to comment.