From: Anurag Dwivedi Date: Wed, 3 May 2017 06:28:44 +0000 (-0400) Subject: Move 'launchpad' directory to 'RIFT_VAR_ROOT' from 'RIFT_ARTIFACTS' X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F42%2F1742%2F1;p=osm%2FSO.git Move 'launchpad' directory to 'RIFT_VAR_ROOT' from 'RIFT_ARTIFACTS' RIFT-16393, RIFT-15616 Signed-off-by: Anurag Dwivedi --- diff --git a/common/python/rift/mano/config_data/config.py b/common/python/rift/mano/config_data/config.py index 63a2e48d..e1a20c93 100644 --- a/common/python/rift/mano/config_data/config.py +++ b/common/python/rift/mano/config_data/config.py @@ -352,7 +352,7 @@ class ConfigPrimitiveConvertor(object): 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): @@ -372,7 +372,7 @@ class ConfigStore(object): the member index ref. """ nsd_archive = os.path.join( - os.getenv('RIFT_ARTIFACTS'), + os.getenv('RIFT_VAR_ROOT'), "launchpad/libs", nsd_id, "config") @@ -406,7 +406,7 @@ class ConfigStore(object): 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") diff --git a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCA.py b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCA.py index 267d6df4..3b4270c3 100644 --- a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCA.py +++ b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCA.py @@ -37,7 +37,7 @@ class RiftCAConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): 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 = {} @@ -247,7 +247,7 @@ class RiftCAConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): # 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): diff --git a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCM_rpc.py b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCM_rpc.py index 4a8dab8d..3b28fba5 100644 --- a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCM_rpc.py +++ b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/RiftCM_rpc.py @@ -55,7 +55,7 @@ class RiftCMRPCHandler(object): 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): @@ -240,7 +240,7 @@ class RiftCMRPCHandler(object): # 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) diff --git a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py index add6a29d..65b5ece4 100644 --- a/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py +++ b/rwcm/plugins/rwconman/rift/tasklets/rwconmantasklet/jujuconf.py @@ -51,7 +51,7 @@ class JujuConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): 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. # @@ -180,7 +180,7 @@ class JujuConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): # 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', @@ -477,7 +477,7 @@ class JujuConfigPlugin(riftcm_config_plugin.RiftCMConfigPluginBase): # 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): diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/charm.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/charm.py index d9077313..4b1a13c0 100644 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/charm.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/charm.py @@ -32,7 +32,7 @@ class PackageCharmExtractor(object): to a known location (RIFT-13282) """ DEFAULT_INSTALL_DIR = os.path.join( - os.environ["RIFT_ARTIFACTS"], + os.environ["RIFT_VAR_ROOT"], "launchpad" ) diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/config.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/config.py index 9a061160..619e924d 100644 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/config.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/config.py @@ -32,7 +32,7 @@ class PackageConfigExtractor(object): to a known location (RIFT-13282) """ DEFAULT_INSTALL_DIR = os.path.join( - os.environ["RIFT_ARTIFACTS"], + os.environ["RIFT_VAR_ROOT"], "launchpad" ) diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py index 9ebd03c8..7b53e72c 100644 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py @@ -199,7 +199,7 @@ class PackageFilesystemStore(object): class NsdPackageFilesystemStore(PackageFilesystemStore): DEFAULT_ROOT_DIR = os.path.join( - os.environ["RIFT_ARTIFACTS"], + os.environ["RIFT_VAR_ROOT"], "launchpad", "packages", "nsd" ) @@ -209,7 +209,7 @@ class NsdPackageFilesystemStore(PackageFilesystemStore): class VnfdPackageFilesystemStore(PackageFilesystemStore): DEFAULT_ROOT_DIR = os.path.join( - os.environ["RIFT_ARTIFACTS"], + os.environ["RIFT_VAR_ROOT"], "launchpad", "packages", "vnfd" ) diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/tasklets/rwlaunchpad/uploader.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/tasklets/rwlaunchpad/uploader.py index c908bb3b..3c83a5f5 100644 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/tasklets/rwlaunchpad/uploader.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/tasklets/rwlaunchpad/uploader.py @@ -675,7 +675,7 @@ class UploaderApplication(tornado.web.Application): 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( diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_export.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_export.py index 7a787c7b..b035e440 100755 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_export.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_export.py @@ -29,6 +29,10 @@ import unittest 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 diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_onboard.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_onboard.py index 871132f5..1af95633 100755 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_onboard.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_onboard.py @@ -31,6 +31,10 @@ import unittest 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 diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_package.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_package.py index 1efd2df7..e00af705 100755 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_package.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_package.py @@ -29,6 +29,10 @@ import unittest 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 diff --git a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_uploader_app_dts.py b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_uploader_app_dts.py index fdc2e22c..d318e836 100755 --- a/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_uploader_app_dts.py +++ b/rwlaunchpad/plugins/rwlaunchpadtasklet/test/utest_uploader_app_dts.py @@ -33,6 +33,10 @@ import tornado.ioloop 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 @@ -97,7 +101,7 @@ class TestCase(rift.test.dts.AbstractDTSTest): 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) @@ -200,7 +204,7 @@ class TestCase(rift.test.dts.AbstractDTSTest): 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) diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py index 0ad877e4..179aab89 100644 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/openmano_nsm.py @@ -42,7 +42,7 @@ if sys.version_info < (3, 4, 4): DUMP_OPENMANO_DIR = os.path.join( - os.environ["RIFT_ARTIFACTS"], + os.environ["RIFT_VAR_ROOT"], "openmano_descriptors" ) diff --git a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py index 7572fe9a..0a4d1fff 100755 --- a/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py +++ b/rwlaunchpad/plugins/rwnsm/rift/tasklets/rwnsmtasklet/rwnsmtasklet.py @@ -2796,10 +2796,10 @@ class NsdDtsHandler(object): @asyncio.coroutine def delete_nsd_libs(nsd_id): - """ Remove any files uploaded with NSD and stored under $RIFT_ARTIFACTS/libs/ """ + """ Remove any files uploaded with NSD and stored under $RIFT_VAR_ROOT/libs/ """ 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) diff --git a/rwlaunchpad/plugins/rwpkgmgr/test/utest_filesystem_proxy_dts.py b/rwlaunchpad/plugins/rwpkgmgr/test/utest_filesystem_proxy_dts.py index 75b310a1..063779c4 100755 --- a/rwlaunchpad/plugins/rwpkgmgr/test/utest_filesystem_proxy_dts.py +++ b/rwlaunchpad/plugins/rwpkgmgr/test/utest_filesystem_proxy_dts.py @@ -62,7 +62,7 @@ class TestCase(rift.test.dts.AbstractDTSTest): 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) diff --git a/rwlaunchpad/plugins/rwpkgmgr/test/utest_publisher_dts.py b/rwlaunchpad/plugins/rwpkgmgr/test/utest_publisher_dts.py index 518b9276..b5ea4805 100755 --- a/rwlaunchpad/plugins/rwpkgmgr/test/utest_publisher_dts.py +++ b/rwlaunchpad/plugins/rwpkgmgr/test/utest_publisher_dts.py @@ -26,6 +26,10 @@ import unittest 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') diff --git a/rwlaunchpad/plugins/rwpkgmgr/test/utest_subscriber_dts.py b/rwlaunchpad/plugins/rwpkgmgr/test/utest_subscriber_dts.py index 4281e11d..9c70dea6 100755 --- a/rwlaunchpad/plugins/rwpkgmgr/test/utest_subscriber_dts.py +++ b/rwlaunchpad/plugins/rwpkgmgr/test/utest_subscriber_dts.py @@ -20,6 +20,10 @@ import sys 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') @@ -135,4 +139,4 @@ def main(argv=sys.argv[1:]): ) if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/server/handler.py b/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/server/handler.py index ce26e064..3027731d 100644 --- a/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/server/handler.py +++ b/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/server/handler.py @@ -48,7 +48,7 @@ class RequestHandler(tornado.web.RequestHandler): 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): diff --git a/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/store/file_store.py b/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/store/file_store.py index aec4180b..04e37d09 100644 --- a/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/store/file_store.py +++ b/rwlaunchpad/plugins/rwstagingmgr/rift/tasklets/rwstagingmgr/store/file_store.py @@ -55,7 +55,7 @@ class StagingFileStore(StagingStorePublisherProtocol): 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 diff --git a/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py b/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py index 9a7e77a1..d378c92f 100755 --- a/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py +++ b/rwlaunchpad/plugins/rwvnfm/rift/tasklets/rwvnfmtasklet/rwvnfmtasklet.py @@ -2713,10 +2713,10 @@ class VnfManager(object): del self._vnfds_to_vnfr[vnfd_id] - # Remove any files uploaded with VNFD and stored under $RIFT_ARTIFACTS/libs/ + # Remove any files uploaded with VNFD and stored under $RIFT_VAR_ROOT/libs/ 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: diff --git a/rwlaunchpad/test/mano_ut.py b/rwlaunchpad/test/mano_ut.py index 69a0d40e..390d38ad 100755 --- a/rwlaunchpad/test/mano_ut.py +++ b/rwlaunchpad/test/mano_ut.py @@ -646,7 +646,7 @@ class PingPongDescriptorPublisher(object): 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") diff --git a/rwlaunchpad/test/tosca_ut.py b/rwlaunchpad/test/tosca_ut.py index 40efe41a..31a9276b 100755 --- a/rwlaunchpad/test/tosca_ut.py +++ b/rwlaunchpad/test/tosca_ut.py @@ -26,6 +26,10 @@ import tempfile 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 diff --git a/rwlaunchpad/test/utest_ro_account.py b/rwlaunchpad/test/utest_ro_account.py index aa485efe..83100d5b 100755 --- a/rwlaunchpad/test/utest_ro_account.py +++ b/rwlaunchpad/test/utest_ro_account.py @@ -20,6 +20,11 @@ import sys 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 @@ -170,4 +175,4 @@ def main(argv=sys.argv[1:]): ) if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/rwlaunchpad/test/utest_rwnsm.py b/rwlaunchpad/test/utest_rwnsm.py index e125739e..48aa03c3 100755 --- a/rwlaunchpad/test/utest_rwnsm.py +++ b/rwlaunchpad/test/utest_rwnsm.py @@ -25,6 +25,10 @@ import unittest 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,