format DeletionDate properly for JSON serialization
This commit is contained in:
parent
786b9ca519
commit
372f749831
@ -9,6 +9,7 @@ from boto.exception import JSONResponseError
|
|||||||
from boto.kms.exceptions import AlreadyExistsException, NotFoundException
|
from boto.kms.exceptions import AlreadyExistsException, NotFoundException
|
||||||
|
|
||||||
from moto.core.responses import BaseResponse
|
from moto.core.responses import BaseResponse
|
||||||
|
from moto.core.utils import iso_8601_datetime_without_milliseconds
|
||||||
from .models import kms_backends
|
from .models import kms_backends
|
||||||
|
|
||||||
reserved_aliases = [
|
reserved_aliases = [
|
||||||
@ -272,7 +273,7 @@ class KmsResponse(BaseResponse):
|
|||||||
try:
|
try:
|
||||||
return json.dumps({
|
return json.dumps({
|
||||||
'KeyId': key_id,
|
'KeyId': key_id,
|
||||||
'DeletionDate': self.kms_backend.schedule_key_deletion(key_id)
|
'DeletionDate': iso_8601_datetime_without_milliseconds(self.kms_backend.schedule_key_deletion(key_id))
|
||||||
})
|
})
|
||||||
except KeyError:
|
except KeyError:
|
||||||
raise JSONResponseError(404, 'Not Found', body={
|
raise JSONResponseError(404, 'Not Found', body={
|
||||||
|
Loading…
x
Reference in New Issue
Block a user