summaryrefslogtreecommitdiffstats
path: root/vnftest/contexts
diff options
context:
space:
mode:
Diffstat (limited to 'vnftest/contexts')
-rw-r--r--vnftest/contexts/base.py13
-rw-r--r--vnftest/contexts/csar.py8
2 files changed, 12 insertions, 9 deletions
diff --git a/vnftest/contexts/base.py b/vnftest/contexts/base.py
index ac1591c..6cb90e9 100644
--- a/vnftest/contexts/base.py
+++ b/vnftest/contexts/base.py
@@ -13,6 +13,8 @@
##############################################################################
import abc
import six
+from vnftest.common import openstack_utils
+
import vnftest.common.utils as utils
import yaml
@@ -39,10 +41,17 @@ class Context(object):
def __init__(self):
Context.list.append(self)
+ self.context_params = None
- @abc.abstractmethod
def init(self, attrs):
- """Initiate context."""
+ self.context_params = {}
+ for key, value in Context.vnf_descriptor.iteritems():
+ key = "context|vnf_descriptor|" + key
+ self.context_params[key] = value
+
+ for key, value in openstack_utils.get_credentials().iteritems():
+ key = "context|creds|" + key
+ self.context_params[key] = value
@staticmethod
def get_cls(context_type):
diff --git a/vnftest/contexts/csar.py b/vnftest/contexts/csar.py
index 2dd4fa4..c3e91e9 100644
--- a/vnftest/contexts/csar.py
+++ b/vnftest/contexts/csar.py
@@ -25,16 +25,10 @@ class CSARContext(Context):
__context_type__ = "CSAR"
def __init__(self):
- self.csar_name = None
- self.csar_id = None
- self.csar_package_location = None
super(CSARContext, self).__init__()
def init(self, attrs):
- """initializes itself from the supplied arguments"""
- self.csar_name = attrs.get("csar_name")
- self.csar_id = attrs.get("csar_id")
- self.csar_package_location = attrs.get("csar_package_location")
+ super(CSARContext, self).init(attrs)
def deploy(self):
"""no need to deploy"""