projects
/
osm
/
SO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug - 356 : 'make ns_scale' fixed
[osm/SO.git]
/
rwlaunchpad
/
plugins
/
rwlaunchpadtasklet
/
rift
/
package
/
store.py
diff --git
a/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py
b/rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py
index
9ebd03c
..
ff25fed
100644
(file)
--- a/
rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py
+++ b/
rwlaunchpad/plugins/rwlaunchpadtasklet/rift/package/store.py
@@
-1,5
+1,5
@@
-#
+#
# Copyright 2016 RIFT.IO Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Copyright 2016 RIFT.IO Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@
-52,9
+52,9
@@
class PackageFilesystemStore(object):
@property
def root_dir(self):
return self._root_dir
@property
def root_dir(self):
return self._root_dir
-
def _get_package_dir(self, package_id):
def _get_package_dir(self, package_id):
+ self._log.debug("Package dir {}, {}".format(self._root_dir, package_id))
return os.path.join(self._root_dir, package_id)
def _get_package_files(self, package_id):
return os.path.join(self._root_dir, package_id)
def _get_package_files(self, package_id):
@@
-129,7
+129,7
@@
class PackageFilesystemStore(object):
return pkg
return pkg
- def store_package(self, pkg):
+ def store_package(self, pkg
, project=None
):
""" Store a DescriptorPackage to disk
Arguments:
""" Store a DescriptorPackage to disk
Arguments:
@@
-142,7
+142,6
@@
class PackageFilesystemStore(object):
raise PackageExistsError("Package %s already exists", pkg.descriptor_id)
package_dir = self._get_package_dir(pkg.descriptor_id)
raise PackageExistsError("Package %s already exists", pkg.descriptor_id)
package_dir = self._get_package_dir(pkg.descriptor_id)
-
try:
os.makedirs(package_dir, exist_ok=True)
except OSError as e:
try:
os.makedirs(package_dir, exist_ok=True)
except OSError as e:
@@
-168,6
+167,8
@@
class PackageFilesystemStore(object):
PackageStoreError - The package could not be deleted
"""
PackageStoreError - The package could not be deleted
"""
+ self.refresh()
+
if descriptor_id not in self._package_dirs:
raise PackageNotFoundError("Package %s does not exists", descriptor_id)
if descriptor_id not in self._package_dirs:
raise PackageNotFoundError("Package %s does not exists", descriptor_id)
@@
-199,20
+200,21
@@
class PackageFilesystemStore(object):
class NsdPackageFilesystemStore(PackageFilesystemStore):
DEFAULT_ROOT_DIR = os.path.join(
class NsdPackageFilesystemStore(PackageFilesystemStore):
DEFAULT_ROOT_DIR = os.path.join(
- os.environ["RIFT_
ARTIFACTS
"],
+ os.environ["RIFT_
VAR_ROOT
"],
"launchpad", "packages", "nsd"
)
"launchpad", "packages", "nsd"
)
- def __init__(self, log, root_dir=DEFAULT_ROOT_DIR):
+ def __init__(self, log, root_dir=DEFAULT_ROOT_DIR, project=None):
+ root_dir = root_dir if not project else os.path.join(root_dir, project)
super().__init__(log, root_dir)
class VnfdPackageFilesystemStore(PackageFilesystemStore):
DEFAULT_ROOT_DIR = os.path.join(
super().__init__(log, root_dir)
class VnfdPackageFilesystemStore(PackageFilesystemStore):
DEFAULT_ROOT_DIR = os.path.join(
- os.environ["RIFT_
ARTIFACTS
"],
+ os.environ["RIFT_
VAR_ROOT
"],
"launchpad", "packages", "vnfd"
)
"launchpad", "packages", "vnfd"
)
- def __init__(self, log, root_dir=DEFAULT_ROOT_DIR):
+ def __init__(self, log, root_dir=DEFAULT_ROOT_DIR, project=None):
+ root_dir = root_dir if not project else os.path.join(root_dir, project)
super().__init__(log, root_dir)
super().__init__(log, root_dir)
-