Browse Source

fix dsconf for setting localrc name=value

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.
Sean Dague 2 years ago
parent
commit
dde87e097f

+ 2
- 2
devstack/dsconf.py View File

@@ -222,11 +222,11 @@ class LocalConf(object):
222 222
         if not os.path.exists(self.fname):
223 223
             with open(self.fname, "w+") as writer:
224 224
                 writer.write("[[local|localrc]]\n")
225
-                writer.write("%s = %s\n" % (name, value))
225
+                writer.write("%s=%s\n" % (name, value))
226 226
                 return
227 227
 
228 228
         def _do_set(writer, line):
229
-            writer.write("%s = %s\n" % (name, value))
229
+            writer.write("%s=%s\n" % (name, value))
230 230
         self._at_insert_point_local(name, _do_set)
231 231
 
232 232
     def _at_insert_point(self, group, conf, section, name, func):

+ 9
- 9
devstack/tests/test_localconf_merge.py View File

@@ -25,9 +25,9 @@ from devstack import dsconf
25 25
 
26 26
 BASIC = """
27 27
 [[local|localrc]]
28
-a = b
29
-c = d
30
-f = 1
28
+a=b
29
+c=d
30
+f=1
31 31
 [[post-config|$NEUTRON_CONF]]
32 32
 [DEFAULT]
33 33
 global_physnet_mtu=1450
@@ -38,8 +38,8 @@ compute = auto
38 38
 
39 39
 LC1 = """
40 40
 [[local|localrc]]
41
-a = 5
42
-g = 2
41
+a=5
42
+g=2
43 43
 [[post-config|$NEUTRON_CONF]]
44 44
 [DEFAULT]
45 45
 global_physnet_mtu=1400
@@ -50,10 +50,10 @@ compute = auto
50 50
 
51 51
 RESULT1 = """
52 52
 [[local|localrc]]
53
-a = 5
54
-c = d
55
-f = 1
56
-g = 2
53
+a=5
54
+c=d
55
+f=1
56
+g=2
57 57
 [[post-config|$NEUTRON_CONF]]
58 58
 [DEFAULT]
59 59
 global_physnet_mtu = 1400

+ 10
- 10
devstack/tests/test_localconf_set_local.py View File

@@ -24,9 +24,9 @@ from devstack import dsconf
24 24
 
25 25
 BASIC = """
26 26
 [[local|localrc]]
27
-a = b
28
-c = d
29
-f = 1
27
+a=b
28
+c=d
29
+f=1
30 30
 [[post-config|$NEUTRON_CONF]]
31 31
 [DEFAULT]
32 32
 global_physnet_mtu=1450
@@ -37,10 +37,10 @@ compute = auto
37 37
 
38 38
 RESULT1 = """
39 39
 [[local|localrc]]
40
-a = b
41
-c = d
42
-f = 1
43
-g = 2
40
+a=b
41
+c=d
42
+f=1
43
+g=2
44 44
 [[post-config|$NEUTRON_CONF]]
45 45
 [DEFAULT]
46 46
 global_physnet_mtu=1450
@@ -51,9 +51,9 @@ compute = auto
51 51
 
52 52
 RESULT2 = """
53 53
 [[local|localrc]]
54
-a = 2
55
-c = d
56
-f = 1
54
+a=2
55
+c=d
56
+f=1
57 57
 [[post-config|$NEUTRON_CONF]]
58 58
 [DEFAULT]
59 59
 global_physnet_mtu=1450

Loading…
Cancel
Save