class ConfigStore(object):
"""Convenience class that fetches all the instance related data from the
- $RIFT_ARTIFACTS/launchpad/libs directory.
+ $RIFT_VAR_ROOT/launchpad/libs directory.
"""
def __init__(self, log):
the member index ref.
"""
nsd_archive = os.path.join(
- os.getenv('RIFT_ARTIFACTS'),
+ os.getenv('RIFT_VAR_ROOT'),
"launchpad/libs",
nsd_id,
"config")
def merge_nsd_config(self, nsd):
nsd_archive = os.path.join(
- os.getenv('RIFT_ARTIFACTS'),
+ os.getenv('RIFT_VAR_ROOT'),
"launchpad/libs",
nsd.id,
"config")
self._name = account.name
self._type = riftcm_config_plugin.DEFAULT_CAP_TYPE
self._rift_install_dir = os.environ['RIFT_INSTALL']
- self._rift_artif_dir = os.environ['RIFT_ARTIFACTS']
+ self._rift_var_root_dir = os.environ['RIFT_VAR_ROOT']
self._rift_vnfs = {}
self._tasks = {}
# The script has full path, use as is
script = rpc_ip.user_defined_script
else:
- script = os.path.join(self._rift_artif_dir, 'launchpad/libs', agent_nsr.nsd_id, 'scripts',
+ script = os.path.join(self._rift_var_root_dir, 'launchpad/libs', agent_nsr.nsd_id, 'scripts',
rpc_ip.user_defined_script)
self._log.debug("Rift config agent: Checking for script in %s", script)
if not os.path.exists(script):
self.job_manager = rift.mano.config_agent.ConfigAgentJobManager(dts, log, loop, nsm)
self._rift_install_dir = os.environ['RIFT_INSTALL']
- self._rift_artif_dir = os.environ['RIFT_ARTIFACTS']
+ self._rift_var_root_dir = os.environ['RIFT_VAR_ROOT']
@property
def reghs(self):
# The script has full path, use as is
script = rpc_ip.user_defined_script
else:
- script = os.path.join(self._rift_artif_dir, 'launchpad/packages/nsd',
+ script = os.path.join(self._rift_var_root_dir, 'launchpad/packages/nsd',
agent_nsr.id, 'scripts',
rpc_ip.user_defined_script)
self._log.debug("CA-RPC: Checking for script in %s", script)
self._user = account.juju.user
self._secret = account.juju.secret
self._rift_install_dir = os.environ['RIFT_INSTALL']
- self._rift_artif_dir = os.environ['RIFT_ARTIFACTS']
+ self._rift_var_root_dir = os.environ['RIFT_VAR_ROOT']
############################################################
# This is wrongfully overloaded with 'juju' private data. #
# Find the charm directory
try:
- path = os.path.join(self._rift_artif_dir,
+ path = os.path.join(self._rift_var_root_dir,
'launchpad/libs',
agent_vnfr.vnfr_msg.vnfd.id,
'charms/trusty',
# The script has full path, use as is
script = rpc_ip.user_defined_script
else:
- script = os.path.join(self._rift_artif_dir, 'launchpad/libs', agent_nsr.id, 'scripts',
+ script = os.path.join(self._rift_var_root_dir, 'launchpad/libs', agent_nsr.id, 'scripts',
rpc_ip.user_defined_script)
self.log.debug("jujuCA: Checking for script in %s", script)
if not os.path.exists(script):
to a known location (RIFT-13282)
"""
DEFAULT_INSTALL_DIR = os.path.join(
- os.environ["RIFT_ARTIFACTS"],
+ os.environ["RIFT_VAR_ROOT"],
"launchpad"
)
to a known location (RIFT-13282)
"""
DEFAULT_INSTALL_DIR = os.path.join(
- os.environ["RIFT_ARTIFACTS"],
+ os.environ["RIFT_VAR_ROOT"],
"launchpad"
)
class NsdPackageFilesystemStore(PackageFilesystemStore):
DEFAULT_ROOT_DIR = os.path.join(
- os.environ["RIFT_ARTIFACTS"],
+ os.environ["RIFT_VAR_ROOT"],
"launchpad", "packages", "nsd"
)
class VnfdPackageFilesystemStore(PackageFilesystemStore):
DEFAULT_ROOT_DIR = os.path.join(
- os.environ["RIFT_ARTIFACTS"],
+ os.environ["RIFT_VAR_ROOT"],
"launchpad", "packages", "vnfd"
)
self.accounts = []
self.messages = collections.defaultdict(list)
- self.export_dir = os.path.join(os.environ['RIFT_ARTIFACTS'], 'launchpad/exports')
+ self.export_dir = os.path.join(os.environ['RIFT_VAR_ROOT'], 'launchpad/exports')
self.uploader = image.ImageUploader(self.log, self.loop, self.dts)
self.onboarder = onboard.DescriptorOnboarder(
import uuid
import xmlrunner
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
import rift.package.archive
import rift.package.charm
import rift.package.checksums
import uuid
import xmlrunner
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
from rift.package import convert
from rift.tasklets.rwlaunchpad import onboard
import rift.test.dts
import xmlrunner
import yaml
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
import rift.package.archive
import rift.package.package
import rift.package.charm
import tornado.web
import tornado.httputil
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
import gi
import requests
from tornado.platform.asyncio import AsyncIOMainLoop
def create_mock_package(self):
uid = str(uuid.uuid4())
path = os.path.join(
- os.getenv('RIFT_ARTIFACTS'),
+ os.getenv('RIFT_VAR_ROOT'),
"launchpad/packages/vnfd",
uid)
data = data[-1]
assert type(data) is export.ExportSuccess
path = os.path.join(
- os.getenv("RIFT_ARTIFACTS"),
+ os.getenv("RIFT_VAR_ROOT"),
"launchpad/exports",
filename)
DUMP_OPENMANO_DIR = os.path.join(
- os.environ["RIFT_ARTIFACTS"],
+ os.environ["RIFT_VAR_ROOT"],
"openmano_descriptors"
)
@asyncio.coroutine
def delete_nsd_libs(nsd_id):
- """ Remove any files uploaded with NSD and stored under $RIFT_ARTIFACTS/libs/<id> """
+ """ Remove any files uploaded with NSD and stored under $RIFT_VAR_ROOT/libs/<id> """
try:
- rift_artifacts_dir = os.environ['RIFT_ARTIFACTS']
- nsd_dir = os.path.join(rift_artifacts_dir, 'launchpad/libs', nsd_id)
+ rift_var_root_dir = os.environ['RIFT_VAR_ROOT']
+ nsd_dir = os.path.join(rift_var_root_dir, 'launchpad/libs', nsd_id)
if os.path.exists (nsd_dir):
shutil.rmtree(nsd_dir, ignore_errors=True)
def create_mock_package(self):
uid = str(uuid.uuid4())
path = os.path.join(
- os.getenv('RIFT_ARTIFACTS'),
+ os.getenv('RIFT_VAR_ROOT'),
"launchpad/packages/vnfd",
uid)
import uuid
import xmlrunner
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
import gi
gi.require_version('RwDts', '1.0')
gi.require_version('RwPkgMgmtYang', '1.0')
import unittest
import uuid
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
import gi
gi.require_version('RwDtsYang', '1.0')
gi.require_version('RwPkgMgmtYang', '1.0')
)
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
class StoreStreamerPart(multipart_streamer.MultiPartStreamer):
"""
Create a Part streamer with a custom temp directory. Using the default
- tmp directory and trying to move the file to $RIFT_ARTIFACTS occasionally
+ tmp directory and trying to move the file to $RIFT_VAR_ROOT occasionally
causes link errors. So create a temp directory within the staging area.
"""
def __init__(self, store, *args, **kwargs):
def __init__(self, log=None, root_dir=None):
default_path = os.path.join(
- os.getenv('RIFT_ARTIFACTS'),
+ os.getenv('RIFT_VAR_ROOT'),
"launchpad/staging")
self.root_dir = root_dir or default_path
del self._vnfds_to_vnfr[vnfd_id]
- # Remove any files uploaded with VNFD and stored under $RIFT_ARTIFACTS/libs/<id>
+ # Remove any files uploaded with VNFD and stored under $RIFT_VAR_ROOT/libs/<id>
try:
- rift_artifacts_dir = os.environ['RIFT_ARTIFACTS']
- vnfd_dir = os.path.join(rift_artifacts_dir, 'launchpad/libs', vnfd_id)
+ rift_var_root_dir = os.environ['RIFT_VAR_ROOT']
+ vnfd_dir = os.path.join(rift_var_root_dir, 'launchpad/libs', vnfd_id)
if os.path.exists(vnfd_dir):
shutil.rmtree(vnfd_dir, ignore_errors=True)
except Exception as e:
use_mon_params=False,
)
- self.config_dir = os.path.join(os.getenv('RIFT_ARTIFACTS'),
+ self.config_dir = os.path.join(os.getenv('RIFT_VAR_ROOT'),
"launchpad/libs",
self.ping_pong_nsd.id,
"config")
import unittest
import xmlrunner
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
import rift.mano.examples.ping_pong_nsd as ping_pong_nsd
from rift.mano.utils.compare_desc import CompareDescShell
import types
import unittest
import uuid
+import os
+
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
import rift.test.dts
import rift.tasklets.rwnsmtasklet.cloud as cloud
)
if __name__ == '__main__':
- main()
\ No newline at end of file
+ main()
import uuid
import xmlrunner
+#Setting RIFT_VAR_ROOT if not already set for unit test execution
+if "RIFT_VAR_ROOT" not in os.environ:
+ os.environ['RIFT_VAR_ROOT'] = os.path.join(os.environ['RIFT_INSTALL'], 'var/rift/unittest')
+
from gi.repository import (
NsdYang,
NsrYang,