projects
/
osm
/
SO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Full Juju Charm support"
[osm/SO.git]
/
rwlaunchpad
/
plugins
/
rwpkgmgr
/
rift
/
tasklets
/
rwpkgmgr
/
downloader
/
url.py
diff --git
a/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/downloader/url.py
b/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/downloader/url.py
index
88155fa
..
e708012
100644
(file)
--- a/
rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/downloader/url.py
+++ b/
rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/downloader/url.py
@@
-13,6
+13,9
@@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# See the License for the specific language governing permissions and
# limitations under the License.
#
+
+import gi
+
import rift.downloader as downloader
from gi.repository import RwPkgMgmtYang
import rift.downloader as downloader
from gi.repository import RwPkgMgmtYang
@@
-30,7
+33,7
@@
class PackageFileDownloader(downloader.UrlDownloader):
}
@classmethod
}
@classmethod
- def from_rpc_input(cls, rpc_input, file_obj, proxy, log=None, auth=None):
+ def from_rpc_input(cls, rpc_input, file_obj, proxy, log=None, auth=None
, project=None
):
"""Convenience class to set up an instance form RPC data
"""
url_downloader = cls(
"""Convenience class to set up an instance form RPC data
"""
url_downloader = cls(
@@
-43,7
+46,8
@@
class PackageFileDownloader(downloader.UrlDownloader):
auth=auth,
proxy=proxy,
file_obj=file_obj,
auth=auth,
proxy=proxy,
file_obj=file_obj,
- log=log)
+ log=log,
+ project=project)
return url_downloader
return url_downloader
@@
-59,7
+63,8
@@
class PackageFileDownloader(downloader.UrlDownloader):
delete_on_fail=True,
decompress_on_fly=False,
auth=None,
delete_on_fail=True,
decompress_on_fly=False,
auth=None,
- log=None):
+ log=None,
+ project=None):
super().__init__(
url,
file_obj=file_obj,
super().__init__(
url,
file_obj=file_obj,
@@
-71,12
+76,14
@@
class PackageFileDownloader(downloader.UrlDownloader):
self.package_id = package_id
self.package_type = package_type
self.package_path = package_path
self.package_id = package_id
self.package_type = package_type
self.package_path = package_path
- self.package_file_type = vnfd_file_type.lower() if vnfd_file_type else nsd_file_type.lower()
+ self.package_file_type = vnfd_file_type.lower() \
+ if package_type == 'VNFD' else nsd_file_type.lower()
self.proxy = proxy
self.proxy = proxy
+ self.project = project
def convert_to_yang(self):
def convert_to_yang(self):
- job = RwPkgMgmtYang.
Download
Job.from_dict({
+ job = RwPkgMgmtYang.
YangData_RwProject_Project_DownloadJobs_
Job.from_dict({
"url": self.meta.url,
"download_id": self.meta.download_id,
"package_id": self.package_id,
"url": self.meta.url,
"download_id": self.meta.download_id,
"package_id": self.package_id,
@@
-112,11
+119,12
@@
class PackageFileDownloader(downloader.UrlDownloader):
self.package_type,
self.package_id,
self.package_path,
self.package_type,
self.package_id,
self.package_path,
- self.package_file_type)
+ self.package_file_type,
+ self.project)
except Exception as e:
self.log.exception(e)
except Exception as e:
self.log.exception(e)
- self.
job
.detail = str(e)
+ self.
meta
.detail = str(e)
self.download_failed()
return
self.download_failed()
return