@freyes and I had a look at this bug and believe the issue stems from ApacheSSLContext defined in cinder_contexts.py[0] never fetching the provided port value in the api-listening-port config option:
The template that renders cinder-wsgi.conf uses 'ext_ports' as the external port[1]
ApacheSSLContext in charm-helpers provides the template that 'ext_ports' value[2]
ApacheSSLContext in cinder_contexts.py defines hard codes external_port as 8776[3]
It doesn't appear that the user-provided port value in 'api-listening-port' gets fetched at all.
def __call__(self):
# late import to work around circular dependency
from cinder_utils import service_enabled
if not service_enabled('api'):
return {}
# fetch the user-provided port if provided and use it as 'external_ports'
if config('api-listening-port') > 0 and config('api-listening-port') < 65536: self.external_ports = [config('api-listening-port')]
return super(ApacheSSLContext, self).__call__()
@freyes and I had a look at this bug and believe the issue stems from ApacheSSLContext defined in cinder_ contexts. py[0] never fetching the provided port value in the api-listening-port config option:
The template that renders cinder-wsgi.conf uses 'ext_ports' as the external port[1]
ApacheSSLContext in charm-helpers provides the template that 'ext_ports' value[2]
ApacheSSLContext in cinder_contexts.py defines hard codes external_port as 8776[3]
It doesn't appear that the user-provided port value in 'api-listening- port' gets fetched at all.
A possible solution could be as follows:
# charm-cinder/ .../hooks/ cinder_ context. py
class ApacheSSLContex t(SSLContext) : namespace = 'cinder'
interfaces = ['https']
external_ports = [8776]
service_
def __call__(self): enabled( 'api'): 'api-listening- port') > 0 and config( 'api-listening- port') < 65536:
self. external_ ports = [config( 'api-listening- port')] Context, self).__call__()
# late import to work around circular dependency
from cinder_utils import service_enabled
if not service_
return {}
# fetch the user-provided port if provided and use it as 'external_ports'
if config(
return super(ApacheSSL
[0] https:/ /opendev. org/openstack/ charm-cinder/ src/branch/ master/ hooks/cinder_ contexts. py#L128 /github. com/juju/ charm-helpers/ blob/master/ charmhelpers/ contrib/ openstack/ templates/ openstack_ https_frontend# L6 /github. com/juju/ charm-helpers/ blob/master/ charmhelpers/ contrib/ openstack/ context. py#L1258 /opendev. org/openstack/ charm-cinder/ src/branch/ master/ hooks/cinder_ contexts. py#L130
[1] https:/
[2] https:/
[3] https:/