aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-02-22 11:10:08 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-02-22 11:10:08 +0000
commit798453153332a29e0c06cf856d92e6d45722c5a1 (patch)
tree18ccfc2bab27b34d9fed3534e4e1782091687bee
parent14d4de1dda0d0c4708c8cb9f5dff4060b628f477 (diff)
parentd7ca703598f48b6d2f9346de3ab6b253c915789e (diff)
Merge "Switch to os.environ for getting OpenStack env vars"
-rw-r--r--sfc/lib/openstack_utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sfc/lib/openstack_utils.py b/sfc/lib/openstack_utils.py
index 362d7308..37ad36f0 100644
--- a/sfc/lib/openstack_utils.py
+++ b/sfc/lib/openstack_utils.py
@@ -5,6 +5,7 @@ import json
import yaml
from tackerclient.tacker import client as tackerclient
from functest.utils.constants import CONST
+from functest.utils import env
from snaps.openstack.tests import openstack_tests
@@ -80,7 +81,7 @@ class OpenStackSFC:
self.creators.append(network_creator)
# Router
- ext_network_name = CONST.__getattribute__('EXTERNAL_NETWORK')
+ ext_network_name = env.get('EXTERNAL_NETWORK')
router_settings = RouterConfig(name=router_name,
external_gateway=ext_network_name,
@@ -582,9 +583,8 @@ def register_vim(tacker_client, vim_file=None):
with open(vim_file) as f:
json_dict = json.load(f)
- json_dict['vim']['auth_url'] = CONST.__getattribute__('OS_AUTH_URL')
- json_dict['vim']['auth_cred']['password'] = CONST.__getattribute__(
- 'OS_PASSWORD')
+ json_dict['vim']['auth_url'] = os.environ['OS_AUTH_URL']
+ json_dict['vim']['auth_cred']['password'] = os.environ['OS_PASSWORD']
json.dump(json_dict, open(tmp_file, 'w'))