flagfile interpolation breaks instance_name_template

Bug #930270 reported by Dean Troyer
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Mark McLoughlin
openstack-common
Fix Released
High
Mark McLoughlin

Bug Description

When --volume_name_template=volume-%08x and --instance_name_template=instance-%08x are present in nova.conf, ConfigParser attempts to interpolate the '%' strings. There are meant for nova to interpolate.

2012-02-10 10:54:49,089 DEBUG nova.service [-] osapi_compute_link_prefix : None from (pid=22867) wait /opt/stack/nova/nova/service.py:409
2012-02-10 10:54:49,089 CRITICAL nova [-] '%' must be followed by '%' or '(', found: '%08x'
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/opt/stack/nova/bin/nova-api", line 53, in <module>
(nova): TRACE: service.wait()
(nova): TRACE: File "/opt/stack/nova/nova/service.py", line 402, in wait
(nova): TRACE: flag_get = FLAGS.get(flag, None)
(nova): TRACE: File "/opt/stack/nova/nova/flags.py", line 73, in get
(nova): TRACE: value = getattr(self, name)
(nova): TRACE: File "/opt/stack/nova/nova/flags.py", line 70, in __getattr__
(nova): TRACE: return getattr(self._conf, name)
(nova): TRACE: File "/opt/stack/nova/nova/openstack/common/cfg.py", line 784, in __getattr__
(nova): TRACE: return self._substitute(self._get(name))
(nova): TRACE: File "/opt/stack/nova/nova/openstack/common/cfg.py", line 985, in _get
(nova): TRACE: return opt._get_from_config_parser(self._cparser, section)
(nova): TRACE: File "/opt/stack/nova/nova/openstack/common/cfg.py", line 433, in _get_from_config_parser
(nova): TRACE: return cparser.get(section, self.dest)
(nova): TRACE: File "/usr/lib/python2.7/ConfigParser.py", line 615, in get
(nova): TRACE: return self._interpolate(section, option, value, d)
(nova): TRACE: File "/usr/lib/python2.7/ConfigParser.py", line 683, in _interpolate
(nova): TRACE: self._interpolate_some(option, L, rawval, section, vars, 1)
(nova): TRACE: File "/usr/lib/python2.7/ConfigParser.py", line 724, in _interpolate_some
(nova): TRACE: "'%%' must be followed by '%%' or '(', found: %r" % (rest,))
(nova): TRACE: InterpolationSyntaxError: '%' must be followed by '%' or '(', found: '%08x'
(nova): TRACE:
stack@356591-essex-k1:/opt/stack/nova$

Tags: cfg
Mark McLoughlin (markmc)
Changed in nova:
assignee: nobody → Mark McLoughlin (markmc)
Changed in openstack-common:
assignee: nobody → Mark McLoughlin (markmc)
Changed in nova:
status: New → In Progress
Changed in openstack-common:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstack-common (master)

Fix proposed to branch: master
Review: https://review.openstack.org/4009

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/4010

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstack-common (master)

Reviewed: https://review.openstack.org/4009
Committed: http://github.com/openstack/openstack-common/commit/8723af7665d004ae088d5066b795877c7d8f890f
Submitter: Jenkins
Branch: master

commit 8723af7665d004ae088d5066b795877c7d8f890f
Author: Mark McLoughlin <email address hidden>
Date: Fri Feb 10 17:14:52 2012 +0000

    Disable ConfigParser interpolation (lp#930270)

    This breaks e.g.

      volume_name_template=volume-%08x
      instance_name_template=instance-%08x

    and is not part of the API contract anyway. We use $opt based value
    interpolation.

    Change-Id: I7ba566ae7c9a77322b52c67c5e1ffbffb760f0fc

Changed in openstack-common:
status: In Progress → Fix Committed
Revision history for this message
Anthony Young (sleepsonthefloor) wrote : Re: flagfile interpolation breaks instance_name_tempalte

Curious if anyone knows how this bug made it past the integration test gate?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/4010
Committed: http://github.com/openstack/nova/commit/6fb0adc066f0f8a64a5ec1fdcbe374b26935485a
Submitter: Jenkins
Branch: master

commit 6fb0adc066f0f8a64a5ec1fdcbe374b26935485a
Author: Mark McLoughlin <email address hidden>
Date: Fri Feb 10 17:19:22 2012 +0000

    Disable ConfigParser interpolation (lp#930270)

    This breaks e.g.

      volume_name_template=volume-%08x
      instance_name_template=instance-%08x

    and is not part of the API contract anyway. We use $opt based value
    interpolation.

    Change-Id: I7659c7a304aac4d30a79751176ecf683bd664e6f

Changed in nova:
status: In Progress → Fix Committed
Michael Still (mikal)
summary: - flagfile interpolation breaks instance_name_tempalte
+ flagfile interpolation breaks instance_name_template
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-4
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
tags: added: cfg
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-4 → 2012.1
Mark McLoughlin (markmc)
Changed in openstack-common:
status: Fix Committed → Fix Released
milestone: none → 2012.1
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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