OPENSTACK_ENDPOINT_TYPE not properly quoted in template

Bug #1514919 reported by Billy Olsen
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
openstack-dashboard (Juju Charms Collection)
Fix Released
High
Billy Olsen

Bug Description

The OPENSTACK_ENDPOINT_TYPE needs to be quoted in the local_settings.py template for the OpenStack Dashboard. It is not properly quoted in the templates, which leads to an error:

 File "/usr/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line 187, in __call__
 self.load_middleware()
 File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 44, in load_middleware
 for middleware_path in settings.MIDDLEWARE_CLASSES:
 File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 54, in __getattr__
 self._setup(name)
 File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup
 self._wrapped = Settings(settings_module)
 File "/usr/lib/python2.7/dist-packages/django/conf/__init__.py", line 128, in __init__
 mod = importlib.import_module(self.SETTINGS_MODULE)
 File "/usr/lib/python2.7/dist-packages/django/utils/importlib.py", line 40, in import_module
 __import__(name)
 File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/settings.py", line 316, in <module>
 from local.local_settings import * # noqa
 File "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/../../openstack_dashboard/local/local_settings.py", line 239, in <module>
 OPENSTACK_ENDPOINT_TYPE = internalURL
 NameError: name 'internalURL' is not defined

Changed in openstack-dashboard (Juju Charms Collection):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Billy Olsen (billy-olsen)
Changed in openstack-dashboard (Juju Charms Collection):
status: Confirmed → Fix Committed
milestone: none → 16.01
tags: added: backport-potential sts
Revision history for this message
Mike Deats (mikedeats) wrote :

I noticed that if you manually set this in local_settings.py:

OPENSTACK_ENDPOINT_TYPE = "adminURL"

Then this gets past the apache error, but throws this error in juju:

2016-01-22 22:57:00 ERROR juju-log Endpoint type specified "adminURL" is not a valid endpoint type
2016-01-22 22:57:00 INFO config-changed Traceback (most recent call last):
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/config-changed", line 284, in <module>
2016-01-22 22:57:00 INFO config-changed main()
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/config-changed", line 277, in main
2016-01-22 22:57:00 INFO config-changed hooks.execute(sys.argv)
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/charmhelpers/core/hookenv.py", line 704, in execute
2016-01-22 22:57:00 INFO config-changed self._hooks[hook_name]()
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/charmhelpers/core/host.py", line 393, in wrapped_f
2016-01-22 22:57:00 INFO config-changed f(*args, **kwargs)
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/config-changed", line 132, in config_changed
2016-01-22 22:57:00 INFO config-changed CONFIGS.write_all()
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 278, in write_all
2016-01-22 22:57:00 INFO config-changed [self.write(k) for k in six.iterkeys(self.templates)]
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 267, in write
2016-01-22 22:57:00 INFO config-changed _out = self.render(config_file)
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 238, in render
2016-01-22 22:57:00 INFO config-changed ctxt = self.templates[config_file].context()
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/charmhelpers/contrib/openstack/templating.py", line 105, in context
2016-01-22 22:57:00 INFO config-changed _ctxt = context()
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/horizon_contexts.py", line 142, in __call__
2016-01-22 22:57:00 INFO config-changed ep_types = [self.normalize(e) for e in ep_types.split(',')]
2016-01-22 22:57:00 INFO config-changed File "/var/lib/juju/agents/unit-openstack-dashboard-2/charm/hooks/horizon_contexts.py", line 91, in normalize
2016-01-22 22:57:00 INFO config-changed raise Exception(msg)

Revision history for this message
Billy Olsen (billy-olsen) wrote :

@mikedeats - that would definitely happen with the simply setting the value in local_settings.py directly. What happens is that a config-changed hook (or other) triggers causing the rendering engine to re-render the local_settings template which isn't properly quoted. If you wanted to fix this locally, you'd need to create a temporary branch of the charm, make your modification, then upgrade the charm. e.g.

James Page (james-page)
Changed in openstack-dashboard (Juju Charms Collection):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.