From cccfbf470af8e846b1f4555687936cd0942d559e Mon Sep 17 00:00:00 2001 From: Delia Popescu Date: Thu, 6 Sep 2018 18:37:11 +0300 Subject: Use environment variable for image properties Use IMAGE_PROPERTIES environment variable to read extra image properties. Set image_extra_properties for scsi volume types without file patch, but using IMAGE_PROPERTIES env variable IMAGE_PROPERTIES is defined through releng. Image extra_properties will continue to get updates from functest config file With this change, remove unnecessary parameters from arm patch Related to:https://gerrit.opnfv.org/gerrit/#/c/63203/ JIRA:ARMBAND-402 Change-Id: I64139240751b1e109bbe24ba32f487ccd98b9a92 Signed-off-by: Delia Popescu (cherry picked from commit d7c5419ed8d3dcdb59f4f5f254de0c7bb7a0aec6) --- functest/core/singlevm.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'functest/core/singlevm.py') diff --git a/functest/core/singlevm.py b/functest/core/singlevm.py index 71ed0690d..d1806eb12 100644 --- a/functest/core/singlevm.py +++ b/functest/core/singlevm.py @@ -23,6 +23,7 @@ from xtesting.core import testcase from functest.core import tenantnetwork from functest.utils import config +from functest.utils import env class VmReady1(tenantnetwork.TenantNetwork1): @@ -73,6 +74,11 @@ class VmReady1(tenantnetwork.TenantNetwork1): """ assert self.cloud 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(',')))) extra_properties.update( getattr(config.CONF, '{}_extra_properties'.format( self.case_name), {})) @@ -104,6 +110,11 @@ class VmReady1(tenantnetwork.TenantNetwork1): """ assert self.cloud 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(',')))) extra_alt_properties.update( getattr(config.CONF, '{}_extra_alt_properties'.format( self.case_name), {})) -- cgit 1.2.3-korg