summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Dague <sean@dague.net>2017-01-17 10:38:03 -0500
committerSean Dague <sean@dague.net>2017-01-17 10:38:03 -0500
commitdde87e097fca533c8e8b4ca77d9eee528643e4fc (patch)
tree0d803247b9bea50e3a71b75251fe6e4c42aaaa68
parent3ecd349bfe5127dbd246777c3553c22a09433315 (diff)
fix dsconf for setting localrc name=value0.1.1
It's important when setting localrc name=value that there are no spaces around the = sign, otherwise it doesn't work. Remember to treat localrc special from the iniset portions.
-rw-r--r--devstack/dsconf.py4
-rw-r--r--devstack/tests/test_localconf_merge.py18
-rw-r--r--devstack/tests/test_localconf_set_local.py20
3 files changed, 21 insertions, 21 deletions
diff --git a/devstack/dsconf.py b/devstack/dsconf.py
index f02478a..2edeedc 100644
--- a/devstack/dsconf.py
+++ b/devstack/dsconf.py
@@ -222,11 +222,11 @@ class LocalConf(object):
222 if not os.path.exists(self.fname): 222 if not os.path.exists(self.fname):
223 with open(self.fname, "w+") as writer: 223 with open(self.fname, "w+") as writer:
224 writer.write("[[local|localrc]]\n") 224 writer.write("[[local|localrc]]\n")
225 writer.write("%s = %s\n" % (name, value)) 225 writer.write("%s=%s\n" % (name, value))
226 return 226 return
227 227
228 def _do_set(writer, line): 228 def _do_set(writer, line):
229 writer.write("%s = %s\n" % (name, value)) 229 writer.write("%s=%s\n" % (name, value))
230 self._at_insert_point_local(name, _do_set) 230 self._at_insert_point_local(name, _do_set)
231 231
232 def _at_insert_point(self, group, conf, section, name, func): 232 def _at_insert_point(self, group, conf, section, name, func):
diff --git a/devstack/tests/test_localconf_merge.py b/devstack/tests/test_localconf_merge.py
index 50d4b74..a6d9424 100644
--- a/devstack/tests/test_localconf_merge.py
+++ b/devstack/tests/test_localconf_merge.py
@@ -25,9 +25,9 @@ from devstack import dsconf
25 25
26BASIC = """ 26BASIC = """
27[[local|localrc]] 27[[local|localrc]]
28a = b 28a=b
29c = d 29c=d
30f = 1 30f=1
31[[post-config|$NEUTRON_CONF]] 31[[post-config|$NEUTRON_CONF]]
32[DEFAULT] 32[DEFAULT]
33global_physnet_mtu=1450 33global_physnet_mtu=1450
@@ -38,8 +38,8 @@ compute = auto
38 38
39LC1 = """ 39LC1 = """
40[[local|localrc]] 40[[local|localrc]]
41a = 5 41a=5
42g = 2 42g=2
43[[post-config|$NEUTRON_CONF]] 43[[post-config|$NEUTRON_CONF]]
44[DEFAULT] 44[DEFAULT]
45global_physnet_mtu=1400 45global_physnet_mtu=1400
@@ -50,10 +50,10 @@ compute = auto
50 50
51RESULT1 = """ 51RESULT1 = """
52[[local|localrc]] 52[[local|localrc]]
53a = 5 53a=5
54c = d 54c=d
55f = 1 55f=1
56g = 2 56g=2
57[[post-config|$NEUTRON_CONF]] 57[[post-config|$NEUTRON_CONF]]
58[DEFAULT] 58[DEFAULT]
59global_physnet_mtu = 1400 59global_physnet_mtu = 1400
diff --git a/devstack/tests/test_localconf_set_local.py b/devstack/tests/test_localconf_set_local.py
index e169d32..a5049e7 100644
--- a/devstack/tests/test_localconf_set_local.py
+++ b/devstack/tests/test_localconf_set_local.py
@@ -24,9 +24,9 @@ from devstack import dsconf
24 24
25BASIC = """ 25BASIC = """
26[[local|localrc]] 26[[local|localrc]]
27a = b 27a=b
28c = d 28c=d
29f = 1 29f=1
30[[post-config|$NEUTRON_CONF]] 30[[post-config|$NEUTRON_CONF]]
31[DEFAULT] 31[DEFAULT]
32global_physnet_mtu=1450 32global_physnet_mtu=1450
@@ -37,10 +37,10 @@ compute = auto
37 37
38RESULT1 = """ 38RESULT1 = """
39[[local|localrc]] 39[[local|localrc]]
40a = b 40a=b
41c = d 41c=d
42f = 1 42f=1
43g = 2 43g=2
44[[post-config|$NEUTRON_CONF]] 44[[post-config|$NEUTRON_CONF]]
45[DEFAULT] 45[DEFAULT]
46global_physnet_mtu=1450 46global_physnet_mtu=1450
@@ -51,9 +51,9 @@ compute = auto
51 51
52RESULT2 = """ 52RESULT2 = """
53[[local|localrc]] 53[[local|localrc]]
54a = 2 54a=2
55c = d 55c=d
56f = 1 56f=1
57[[post-config|$NEUTRON_CONF]] 57[[post-config|$NEUTRON_CONF]]
58[DEFAULT] 58[DEFAULT]
59global_physnet_mtu=1450 59global_physnet_mtu=1450