Double-quotes not removed from some nova.conf config values

Bug #987473 reported by Manu Sporny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
New
Undecided
Unassigned

Bug Description

The current nova.conf.sample file contains double-quote characters in the value portion of key-value pairs for things like the "image_service" configuration option:

https://github.com/openstack/nova/blob/e7ebcf34c13e33811e20d8dca1c5e8e7af3ea4ca/etc/nova/nova.conf.sample#L95

While the Python INI file reader does a fine job of removing the double-quotes, there are a number of code paths in the OpenStack software that don't remove the double quotes. If the source line above were to be uncommented, the following error will occur (pay special attention to the name of the module name - which is DOUBLE_QUOTEnova.image.glance and not nova.image.glance. There is no module named "nova.image.glance and therefore, the following stack trace occurs:

2012-04-23 14:45:15 CRITICAL nova [-] Class GlanceImageService" could not be found: No module named "nova.image.glance
2012-04-23 14:45:15 TRACE nova Traceback (most recent call last):
2012-04-23 14:45:15 TRACE nova File "/usr/bin/nova-api", line 51, in <module>
2012-04-23 14:45:15 TRACE nova servers.append(service.WSGIService(api))
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/service.py", line 326, in __init__
2012-04-23 14:45:15 TRACE nova self.app = self.loader.load_app(name)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/wsgi.py", line 388, in load_app
2012-04-23 14:45:15 TRACE nova return deploy.loadapp("config:%s" % self.config_path, name=name)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 247, in loadapp
2012-04-23 14:45:15 TRACE nova return loadobj(APP, uri, name=name, **kw)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 272, in loadobj
2012-04-23 14:45:15 TRACE nova return context.create()
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 710, in create
2012-04-23 14:45:15 TRACE nova return self.object_type.invoke(self)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2012-04-23 14:45:15 TRACE nova **context.local_conf)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/util.py", line 56, in fix_call
2012-04-23 14:45:15 TRACE nova val = callable(*args, **kw)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/urlmap.py", line 25, in urlmap_factory
2012-04-23 14:45:15 TRACE nova app = loader.get_app(app_name, global_conf=global_conf)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 350, in get_app
2012-04-23 14:45:15 TRACE nova name=name, global_conf=global_conf).create()
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 710, in create
2012-04-23 14:45:15 TRACE nova return self.object_type.invoke(self)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/loadwsgi.py", line 144, in invoke
2012-04-23 14:45:15 TRACE nova **context.local_conf)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/paste/deploy/util.py", line 56, in fix_call
2012-04-23 14:45:15 TRACE nova val = callable(*args, **kw)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/api/auth.py", line 52, in pipeline_factory
2012-04-23 14:45:15 TRACE nova app = filter(app)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/wsgi.py", line 244, in _factory
2012-04-23 14:45:15 TRACE nova return cls(app, **local_config)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/api/ec2/__init__.py", line 413, in __init__
2012-04-23 14:45:15 TRACE nova self.controller = utils.import_class(controller)()
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/api/ec2/cloud.py", line 210, in __init__
2012-04-23 14:45:15 TRACE nova self.image_service = s3.S3ImageService()
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/image/s3.py", line 71, in __init__
2012-04-23 14:45:15 TRACE nova self.service = service or image.get_default_image_service()
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/image/__init__.py", line 28, in get_default_image_service
2012-04-23 14:45:15 TRACE nova ImageService = utils.import_class(FLAGS.image_service)
2012-04-23 14:45:15 TRACE nova File "/usr/lib/python2.6/site-packages/nova/utils.py", line 80, in import_class
2012-04-23 14:45:15 TRACE nova raise exception.ClassNotFound(class_name=class_str, exception=exc)
2012-04-23 14:45:15 TRACE nova ClassNotFound: Class GlanceImageService" could not be found: No module named "nova.image.glance

Also note the class name is GlanceImageServiceDOUBLE_QUOTE and not GlanceImageService.

Either fix the way that modules and class names are extracted from the configuration file, or remove the double-quoted values from the config file. I'd suggest doing the former as it seems like a bug to not use the values returned by the Python ConfigParser (since they go through some sanitizer steps before being handed off to the developer).

Thanks for OpenStack - enjoying it so far :)

Tags: docimpact
Manu Sporny (msporny)
summary: - nova.conf.sample contains illegal INI file format characters
+ Double-quotes not removed from some nova.conf config values
Anne Gentle (annegentle)
tags: added: docimpact
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.