aboutsummaryrefslogtreecommitdiffstats
path: root/functest/core
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-10-14 12:08:03 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2018-10-14 13:27:59 +0200
commit06a1649e11007ee4d8f61562839cdb58fe0ed783 (patch)
tree11defd46c41e0715a4d60c7b4f53309f9b2056b1 /functest/core
parent19a00e2eb8f6cb0aa0ed6d18f41b006857e22550 (diff)
Fix image properties parsing
It removes useless spaces and now conforms with oslo.conf dict. New helpers and unit tests are available. Change-Id: I20335c5e5c3840cc872e158c6072d97a3f2cb98c Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com> (cherry picked from commit 904377462f58464937d4cafeb8c432f024a85bd4)
Diffstat (limited to 'functest/core')
-rw-r--r--functest/core/singlevm.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py
index d1806eb12..b3a1417f6 100644
--- a/functest/core/singlevm.py
+++ b/functest/core/singlevm.py
@@ -24,6 +24,7 @@ from xtesting.core import testcase
from functest.core import tenantnetwork
from functest.utils import config
from functest.utils import env
+from functest.utils import functest_utils
class VmReady1(tenantnetwork.TenantNetwork1):
@@ -76,9 +77,8 @@ class VmReady1(tenantnetwork.TenantNetwork1):
extra_properties = self.extra_properties.copy()
if env.get('IMAGE_PROPERTIES'):
extra_properties.update(
- dict((k.strip(), v.strip()) for k, v in (
- item.split(': ') for item in env.get(
- 'IMAGE_PROPERTIES').split(','))))
+ functest_utils.convert_ini_to_dict(
+ env.get('IMAGE_PROPERTIES')))
extra_properties.update(
getattr(config.CONF, '{}_extra_properties'.format(
self.case_name), {}))
@@ -112,9 +112,8 @@ class VmReady1(tenantnetwork.TenantNetwork1):
extra_alt_properties = self.extra_alt_properties.copy()
if env.get('IMAGE_PROPERTIES'):
extra_alt_properties.update(
- dict((k.strip(), v.strip()) for k, v in (
- item.split(': ') for item in env.get(
- 'IMAGE_PROPERTIES').split(','))))
+ functest_utils.convert_ini_to_dict(
+ env.get('IMAGE_PROPERTIES')))
extra_alt_properties.update(
getattr(config.CONF, '{}_extra_alt_properties'.format(
self.case_name), {}))