The value of one of our config properties, specifically metering_secret in /etc/ceilometer/ceilometer.conf, had a dollar sign ($) in it and this caused an error when starting the service because the value wasn't parsed properly:
Trace back:
[-] no such option: k2
ceilometer Traceback (most recent call last):
File "/usr/bin/ceilometer-collector", line 10, in <module>
sys.exit(collector())
File "/usr/lib/python2.6/site-packages/ceilometer/collector/service.py", line 299, in collector
'ceilometer.collector')).wait()
File "/usr/lib/python2.6/site-packages/ceilometer/openstack/common/service.py", line 162, in wait
status, signo = self._wait_for_exit_or_signal()
File "/usr/lib/python2.6/site-packages/ceilometer/openstack/common/service.py", line 137, in _wait_for_exit_or_si gnal
CONF.log_opt_values(LOG, std_logging.DEBUG)
File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 1949, in log_opt_values
_sanitize(opt, getattr(group_attr, opt_name)))
File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 2192, in __getattr__
return self._conf._get(name, self._group)
File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 1992, in _get
value = self._substitute(self._do_get(name, group, namespace))
File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 2048, in _substitute
return tmpl.safe_substitute(self.StrSubWrapper(self))
File "/usr/lib64/python2.6/string.py", line 205, in safe_substitute
return self.pattern.sub(convert, self.template)
File "/usr/lib64/python2.6/string.py", line 190, in convert
return '%s' % (mapping[named],)
File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 2266, in __getitem__
value = getattr(self.conf, key)
File "/usr/lib/python2.6/site-packages/oslo/config/cfg.py", line 1648, in __getattr__
raise NoSuchOptError(name)
NoSuchOptError: no such option: k2
So, the line in the config file looked something like this:
metering_secret=foobar-somethin$k2-foo-something
The oslo config parser must be interpreting regex characters or something. We tried quoting and escaping (via a backslash) to work around this issue, but neither worked.
We are using Python String templates so the escape is '$$' - please see http:// docs.python. org/2/library/ string. html#template- strings
I am adding a review to treat '\$' to be an escape as well