summaryrefslogtreecommitdiffstats
path: root/sfc
diff options
context:
space:
mode:
authorGeorge Paraskevopoulos <geopar@intracom-telecom.com>2017-01-11 15:49:57 +0200
committerGeorge Paraskevopoulos <geopar@intracom-telecom.com>2017-01-11 14:22:43 +0000
commit40460e0dd7395a0a95b7ee52119a796cd3d500ab (patch)
tree1ecb7cb6b04fb30734a3447e9b16c3be50104f44 /sfc
parentaf163a7f4bd4d8c8cd5478360e7f79fd40cb0a62 (diff)
Get Fuel environment id from configuration
JIRA: SFC-65 Get the id of the fuel environment from config.yaml instead of an environmental variable Change-Id: I39e61200986b407ae19cc9f7c1384c34c8410c8b Signed-off-by: George Paraskevopoulos <geopar@intracom-telecom.com>
Diffstat (limited to 'sfc')
-rw-r--r--sfc/lib/config.py5
-rw-r--r--sfc/lib/utils.py3
-rw-r--r--sfc/tests/functest/config.yaml1
3 files changed, 8 insertions, 1 deletions
diff --git a/sfc/lib/config.py b/sfc/lib/config.py
index c415627f..bb7f13f2 100644
--- a/sfc/lib/config.py
+++ b/sfc/lib/config.py
@@ -45,6 +45,11 @@ class CommonConfig(object):
'username': self.fuel_master_uname,
'password': self.fuel_master_passwd
}
+ try:
+ self.fuel_environment = ft_utils.get_parameter_from_yaml(
+ "defaults.fuel_environment", self.config_file)
+ except:
+ self.fuel_environment = None
self.flavor = ft_utils.get_parameter_from_yaml(
"defaults.flavor", self.config_file)
self.ram_size_in_mb = ft_utils.get_parameter_from_yaml(
diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py
index 00f98985..1140e5b0 100644
--- a/sfc/lib/utils.py
+++ b/sfc/lib/utils.py
@@ -18,6 +18,7 @@ import functest.utils.functest_logger as ft_logger
import functest.utils.functest_utils as ft_utils
import functest.utils.openstack_utils as os_utils
import opnfv.utils.SSHUtils as ssh_utils
+import sfc.lib.config as sfc_config
logger = ft_logger.Logger("sfc_test_utils").getLogger()
@@ -87,7 +88,7 @@ def run_cmd_remote(ip, cmd, username="root", passwd="opnfv"):
def get_openstack_node_ips(role):
"""Get OpenStack Nodes IP Address"""
- fuel_env = os.environ.get("FUEL_ENV")
+ fuel_env = sfc_config.CommonConfig().fuel_environment
if fuel_env is not None:
cmd = "fuel2 node list -f json -e %s" % fuel_env
else:
diff --git a/sfc/tests/functest/config.yaml b/sfc/tests/functest/config.yaml
index 78cf42fb..9acca599 100644
--- a/sfc/tests/functest/config.yaml
+++ b/sfc/tests/functest/config.yaml
@@ -9,6 +9,7 @@ defaults:
fuel_master_ip: 10.20.0.2
fuel_master_uname: root
fuel_master_passwd: r00tme
+ fuel_environment: # Change this to the id of the desired fuel env (1, 2, 3...)
image_format: qcow2
url: "http://artifacts.opnfv.org/sfc/demo"
vnfd-dir: "vnfd-templates"