do not require secret to exist on PutSecretValue operation

This commit is contained in:
= 2020-04-24 18:17:03 +02:00
parent 3e145ef8df
commit 6483e3be80

View File

@ -227,9 +227,13 @@ class SecretsManagerBackend(BaseBackend):
def put_secret_value(self, secret_id, secret_string, secret_binary, version_stages): def put_secret_value(self, secret_id, secret_string, secret_binary, version_stages):
secret = self.secrets[secret_id] if secret_id in self.secrets.keys():
tags = secret["tags"] secret = self.secrets[secret_id]
description = secret["description"] tags = secret["tags"]
description = secret["description"]
else:
tags = []
description = ""
version_id = self._add_secret( version_id = self._add_secret(
secret_id, secret_string, secret_binary, description=description, tags=tags, version_stages=version_stages secret_id, secret_string, secret_binary, description=description, tags=tags, version_stages=version_stages
@ -427,7 +431,7 @@ class SecretsManagerBackend(BaseBackend):
{ {
"ARN": secret_arn(self.region, secret["secret_id"]), "ARN": secret_arn(self.region, secret["secret_id"]),
"DeletedDate": secret.get("deleted_date", None), "DeletedDate": secret.get("deleted_date", None),
"Description": secret.get["description"], "Description": secret.get("description", ""),
"KmsKeyId": "", "KmsKeyId": "",
"LastAccessedDate": None, "LastAccessedDate": None,
"LastChangedDate": None, "LastChangedDate": None,