IAM delete_server_certificate (#1380)
* IAM delete_server_certificate * flake8 fixes
This commit is contained in:
parent
0c01c7f495
commit
52ce8d378f
4 changed files with 34 additions and 1 deletions
|
|
@ -663,6 +663,20 @@ class IAMBackend(BaseBackend):
|
|||
"The Server Certificate with name {0} cannot be "
|
||||
"found.".format(name))
|
||||
|
||||
def delete_server_certificate(self, name):
|
||||
cert_id = None
|
||||
for key, cert in self.certificates.items():
|
||||
if name == cert.cert_name:
|
||||
cert_id = key
|
||||
break
|
||||
|
||||
if cert_id is None:
|
||||
raise IAMNotFoundException(
|
||||
"The Server Certificate with name {0} cannot be "
|
||||
"found.".format(name))
|
||||
|
||||
self.certificates.pop(cert_id, None)
|
||||
|
||||
def create_group(self, group_name, path='/'):
|
||||
if group_name in self.groups:
|
||||
raise IAMConflictException(
|
||||
|
|
|
|||
|
|
@ -271,6 +271,12 @@ class IamResponse(BaseResponse):
|
|||
template = self.response_template(GET_SERVER_CERTIFICATE_TEMPLATE)
|
||||
return template.render(certificate=cert)
|
||||
|
||||
def delete_server_certificate(self):
|
||||
cert_name = self._get_param('ServerCertificateName')
|
||||
iam_backend.delete_server_certificate(cert_name)
|
||||
template = self.response_template(GENERIC_EMPTY_TEMPLATE)
|
||||
return template.render(name="DeleteServerCertificate")
|
||||
|
||||
def create_group(self):
|
||||
group_name = self._get_param('GroupName')
|
||||
path = self._get_param('Path')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue