Merge "Allow certificate install when HTTPS is false"

This commit is contained in:
Zuul 2021-12-02 00:48:38 +00:00 committed by Gerrit Code Review
commit ed4a042a3e
1 changed files with 0 additions and 26 deletions

View File

@ -305,9 +305,6 @@ class CertificateController(rest.RestController):
# Default certificate install is non-tpm SSL
mode = constants.CERT_MODE_SSL
system = pecan.request.dbapi.isystem_get_one()
capabilities = system.capabilities
# platform-cert 'force' check for backward compatibility
if self._is_mode_supported_by_cert_manager(mode):
# Call may not contain 'force' parameter
@ -331,29 +328,6 @@ class CertificateController(rest.RestController):
LOG.info(msg)
return dict(success="", error=msg)
standalone_certs = [constants.CERT_MODE_DOCKER_REGISTRY,
constants.CERT_MODE_SSL_CA]
if mode not in standalone_certs:
system_https_enabled = capabilities.get('https_enabled', False)
if system_https_enabled is False or system_https_enabled == 'n':
msg = "No certificates have been added, https is not enabled."
LOG.info(msg)
return dict(success="", error=msg)
if mode.startswith(constants.CERT_MODE_OPENSTACK):
try:
pecan.request.dbapi.certificate_get_by_certtype(
constants.CERT_MODE_SSL)
except exception.CertificateTypeNotFound:
try:
pecan.request.dbapi.certificate_get_by_certtype(
constants.CERT_MODE_TPM)
except exception.CertificateTypeNotFound:
msg = "No openstack certificates have been added, " \
"platform SSL certificate is not installed."
LOG.info(msg)
return dict(success="", error=msg)
if not fileitem.filename:
return dict(success="", error="Error: No file uploaded")
try: