summaryrefslogtreecommitdiffstats
path: root/vnftest/contexts/base.py
diff options
context:
space:
mode:
authorMoshe <moshehoa@amdocs.com>2018-08-15 12:19:07 +0300
committerMoshe <moshehoa@amdocs.com>2018-08-15 17:00:11 +0300
commit5e5e493a5ec5048c0a340e2acd72f52869779fdf (patch)
treeb4f787f6df2a4414660d7f235dfc128cc86fdc2e /vnftest/contexts/base.py
parent1a54248ad5b5f836ae915413ffefaa487d1f73f5 (diff)
versionize tests due to API changes in ONAP
Issue-ID: VNFSDK-301 Change-Id: I1fdf1b42fc2cd44021c2f33695c86bbbdc8bb62b Signed-off-by: Moshe <moshehoa@amdocs.com> fix tests Issue-ID: VNFSDK-301 Change-Id: I87abc962b13956af07ad8bf7355ea681343664dc Signed-off-by: Moshe <moshehoa@amdocs.com>
Diffstat (limited to 'vnftest/contexts/base.py')
-rw-r--r--vnftest/contexts/base.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/vnftest/contexts/base.py b/vnftest/contexts/base.py
index 47dbf01..c6f3992 100644
--- a/vnftest/contexts/base.py
+++ b/vnftest/contexts/base.py
@@ -17,21 +17,32 @@ from vnftest.common import openstack_utils
import vnftest.common.utils as utils
import yaml
-
+import logging
+LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Context(object):
"""Class that represents a context in the logical model"""
list = []
vnf_descriptor = {}
+ onap_env_config = {}
creds = {}
@classmethod
- def initialize(cls, vnf_descriptor_path):
+ def initialize(cls, vnf_descriptor_path, environment_path):
+ LOG.info('vnf descriptor path: %s', str(vnf_descriptor_path))
+ LOG.info('environment path: %s', str(environment_path))
with open(vnf_descriptor_path) as f:
cls.vnf_descriptor = yaml.safe_load(f)
- for key, value in openstack_utils.get_credentials().iteritems():
- cls.creds[key] = value
+ with open(environment_path) as f:
+ environment_config = yaml.safe_load(f)
+ openstack_env_config = environment_config['openstack']
+ openstack_utils.initialize(openstack_env_config)
+ cls.onap_env_config = environment_config['onap']
+
+ cls.creds = openstack_utils.get_credentials()
+
+
@staticmethod
def split_name(name, sep='.'):