summaryrefslogtreecommitdiffstats
path: root/sfc/lib/config.py
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-03-24 17:07:21 +0100
committerManuel Buil <mbuil@suse.com>2018-04-09 14:11:32 +0000
commit72a3642bd686271a88f50ebe76efabdd9a868617 (patch)
treedf6c7301d2c20bb503754fbf7fbbcf0c4c4dddde /sfc/lib/config.py
parent435685b3384b3bd7741324368b6912dfd4b84ef5 (diff)
Use different config files depending on version
We can read the openstack version from the env variables and then use a different config. The reason we use this is because openstack API changed from Pike to Queens and Pike is the official version for OPNFV Fraser release Change-Id: I8a94e71224d2ba0aa75a6438f3d7b03929acbbef Signed-off-by: Manuel Buil <mbuil@suse.com> (cherry picked from commit a459dee88ba00d6f8283232ce2159594ae23d22a)
Diffstat (limited to 'sfc/lib/config.py')
-rw-r--r--sfc/lib/config.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/sfc/lib/config.py b/sfc/lib/config.py
index 8cc1efb4..a4f5d67b 100644
--- a/sfc/lib/config.py
+++ b/sfc/lib/config.py
@@ -43,7 +43,21 @@ class CommonConfig(object):
self.vnffgd_dir = os.path.join(self.sfc_test_dir, "vnffgd-templates")
self.functest_results_dir = os.path.join(
getattr(config.CONF, 'dir_results'), "odl-sfc")
- self.config_file = os.path.join(self.sfc_test_dir, "config.yaml")
+
+ # We need to know the openstack version in order to use one config or
+ # another. For Pike we will use config-pike.yaml. Queens and Rocky
+ # will use config.yaml
+ if 'OPENSTACK_OSA_VERSION' in os.environ:
+ if os.environ['OPENSTACK_OSA_VERSION'] == 'stable/pike':
+ self.config_file = os.path.join(self.sfc_test_dir,
+ "config-pike.yaml")
+ else:
+ self.config_file = os.path.join(self.sfc_test_dir,
+ "config.yaml")
+ else:
+ self.config_file = os.path.join(self.sfc_test_dir,
+ "config-pike.yaml")
+
self.vim_file = os.path.join(self.sfc_test_dir, "register-vim.json")
self.installer_type = env.get('INSTALLER_TYPE')