def delete_certificate_by_alias(self, tenant, alias): certificate = domain_repo.get_certificate_by_alias( tenant.tenant_id, alias) if certificate: certificate.delete() return 200, "success" else: return 404, "证书不存在"
def __check_certificate_alias(self, tenant, alias): if domain_repo.get_certificate_by_alias(tenant.tenant_id, alias): raise err_cert_name_exists
def __check_certificate_alias(self, tenant, alias): # r = re.compile("^[A-Za-z0-9]+$") # if not r.match(alias): # return 400, u"证书别名只能是数字和字母的组合" if domain_repo.get_certificate_by_alias(tenant.tenant_id, alias): raise err_cert_name_exists