fix linting issues

This commit is contained in:
mattsb42-aws 2019-08-28 00:48:53 -07:00
parent 776a54b89f
commit 819d354af3

View File

@ -10,7 +10,6 @@ import six
from moto.core.responses import BaseResponse from moto.core.responses import BaseResponse
from .models import kms_backends from .models import kms_backends
from .exceptions import NotFoundException, ValidationException, AlreadyExistsException, NotAuthorizedException from .exceptions import NotFoundException, ValidationException, AlreadyExistsException, NotAuthorizedException
from .utils import decrypt, encrypt
reserved_aliases = [ reserved_aliases = [
'alias/aws/ebs', 'alias/aws/ebs',
@ -345,19 +344,17 @@ class KmsResponse(BaseResponse):
if number_of_bytes and (number_of_bytes > 1024 or number_of_bytes < 0): if number_of_bytes and (number_of_bytes > 1024 or number_of_bytes < 0):
raise ValidationException(( raise ValidationException((
"1 validation error detected: Value '{number_of_bytes:d}' at 'numberOfBytes' failed " "1 validation error detected: Value '{number_of_bytes:d}' at 'numberOfBytes' failed "
"to satisfy constraint: Member must have value less than or " "to satisfy constraint: Member must have value less than or "
"equal to 1024" "equal to 1024"
).format(number_of_bytes=number_of_bytes) ).format(number_of_bytes=number_of_bytes))
)
if key_spec and key_spec not in ('AES_256', 'AES_128'): if key_spec and key_spec not in ('AES_256', 'AES_128'):
raise ValidationException(( raise ValidationException((
"1 validation error detected: Value '{key_spec}' at 'keySpec' failed " "1 validation error detected: Value '{key_spec}' at 'keySpec' failed "
"to satisfy constraint: Member must satisfy enum value set: " "to satisfy constraint: Member must satisfy enum value set: "
"[AES_256, AES_128]" "[AES_256, AES_128]"
).format(key_spec=key_spec) ).format(key_spec=key_spec))
)
if not key_spec and not number_of_bytes: if not key_spec and not number_of_bytes:
raise ValidationException("Please specify either number of bytes or key spec.") raise ValidationException("Please specify either number of bytes or key spec.")
if key_spec and number_of_bytes: if key_spec and number_of_bytes: