This commit is contained in:
mwas 2019-11-23 13:02:00 +03:00
parent 66c9d15ca8
commit 0e825a5048
2 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ def get_secret_name_from_arn(secret_id):
# split the arn by colon
# then get the last value which is the name appended with a random string
# then remove the random string
secret_id = '-'.join(secret_id.split(':')[-1].split('-')[:-1])
secret_id = "-".join(secret_id.split(":")[-1].split("-")[:-1])
return secret_id

View File

@ -378,11 +378,11 @@ def test_describe_secret_with_arn():
conn = boto3.client("secretsmanager", region_name="us-west-2")
results = conn.create_secret(Name="test-secret", SecretString="foosecret")
secret_description = conn.describe_secret(SecretId=results['ARN'])
secret_description = conn.describe_secret(SecretId=results["ARN"])
assert secret_description # Returned dict is not empty
assert secret_description["Name"] == ("test-secret")
assert secret_description["ARN"] != results['ARN']
assert secret_description["ARN"] != results["ARN"]
@mock_secretsmanager