transform DeletionDate in model instead to accomodate Key.to_dict

This commit is contained in:
Jon Beilke 2018-10-06 01:47:22 -05:00
commit 398dcd8230
2 changed files with 4 additions and 4 deletions

View file

@ -9,7 +9,6 @@ from boto.exception import JSONResponseError
from boto.kms.exceptions import AlreadyExistsException, NotFoundException
from moto.core.responses import BaseResponse
from moto.core.utils import iso_8601_datetime_without_milliseconds
from .models import kms_backends
reserved_aliases = [
@ -277,7 +276,7 @@ class KmsResponse(BaseResponse):
try:
return json.dumps({
'KeyId': key_id,
'DeletionDate': iso_8601_datetime_without_milliseconds(self.kms_backend.schedule_key_deletion(key_id, pending_window_in_days))
'DeletionDate': self.kms_backend.schedule_key_deletion(key_id, pending_window_in_days)
})
except KeyError:
raise JSONResponseError(404, 'Not Found', body={