From 15c24e49f0633b7cbe09378dfe22dc94e9190e1f Mon Sep 17 00:00:00 2001 From: Jon Beilke Date: Fri, 5 Oct 2018 16:00:20 -0500 Subject: [PATCH] fix formatting for including DeletionDate in response --- moto/kms/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moto/kms/models.py b/moto/kms/models.py index 30a01d366..4ac6ee845 100644 --- a/moto/kms/models.py +++ b/moto/kms/models.py @@ -41,7 +41,8 @@ class Key(BaseModel): "KeyState": self.key_state, } } - key_dict['KeyMetadata']['DeletionDate'] = self.deletion_date if self.key_state == 'PendingDeletion' + if self.key_state == 'PendingDeletion': + key_dict['KeyMetadata']['DeletionDate'] = self.deletion_date return key_dict def delete(self, region_name):