devstack/tests
Fergal Mc Carthy cc87c2871d local.conf processing doesn't handle '=' in values
When attempting to add a libvirt section with a volume_drivers entry
to $NOVA_CONF, via a post-config block in the local.conf file, I
encountered problems; the value for this attribute takes the form

    driver=python.import.path.to.driver

but the value actually populated in the $NOVA_CONF was truncated at the
equals.

Taking the iscsi driver setting specified in the official nova.conf
documentation as an example, if I have the following in my local.conf
file:

[[post-config|$NOVA_CONF]]
[libvirt]
volume_drivers = iscsi=nova.virt.libvirt.volume.LibvirtISCSIVolumeDriver

I will see that the generated $NOVA_CONF has the following:

[libvirt]
volume_driver = iscsi

This occurs because the existing handling for a post-config setion, as
implemented in merge_config_file(), splits the line on the equals sign,
and then uses the first and seconds elements of the resulting array as
attribute name and value respectively.

However when an equals occurs as part of the value this results in the
value being truncated at the first equals in the value.

The fix I've implemented, based upon review feedback, extracts the
contents of $0 before the first equals as the attr name, and extracts
the remainder after the equals as the value. Then it strips the leading
and trailing whitespaces from both as appropriate.

I've also added test5 to tests/test_config.sh to test for, and verify,
correct operation when this scenario is encountered.  Similarly I've
added test6 to ensure that trailing spaces in values are stripped
correctly.

Change-Id: Id0cb1e6e1cece21bc5dbf427c4d756af86fbd927
Closes-Bug: #1374482
2014-10-10 08:25:38 -04:00
..
fake-service.sh Run processes without screen 2014-09-09 13:54:01 +01:00
functions.sh Enforce function declaration format in bash8 2014-02-28 07:59:03 +11:00
run-process.sh Replace screen_it() with run_process() throughout 2014-09-11 18:59:39 +01:00
test_config.sh local.conf processing doesn't handle '=' in values 2014-10-10 08:25:38 -04:00
test_ini.sh Handle the case of pipe char in value for iniset 2013-12-12 12:24:55 +00:00
test_ip.sh Remove python-netaddr requirement 2013-07-24 12:25:35 -05:00