remove dead code

because the key ID validation is now centralized,
by the time this code would have been reached,
we know that the key ID exists,
so a KeyError will never be thrown
This commit is contained in:
mattsb42-aws 2019-09-13 13:35:55 -07:00
parent 24832982d4
commit 4f34af95bc

View File

@ -152,13 +152,10 @@ class KmsResponse(BaseResponse):
self._validate_key_id(key_id)
try:
key = self.kms_backend.describe_key(
self.kms_backend.get_key_id(key_id))
except KeyError:
headers = dict(self.headers)
headers['status'] = 404
return "{}", headers
key = self.kms_backend.describe_key(
self.kms_backend.get_key_id(key_id)
)
return json.dumps(key.to_dict())
def list_keys(self):