Merge changes I4fd0f119,Ie3aa6347 into v2.0
authorvelandy <rajesh.velandy@riftio.com>
Mon, 15 May 2017 17:13:58 +0000 (19:13 +0200)
committerGerrit Code Review <root@osm.etsi.org>
Mon, 15 May 2017 17:13:58 +0000 (19:13 +0200)
* changes:
  RIFT 16526 Copy the icon image also to the UI logos location for UI update.
  RIFT 16501 get-package-endpoint now requires a valid package-type.

rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/proxy/filesystem.py
rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/rpc.py

index 2acfed1..7111092 100644 (file)
@@ -22,6 +22,7 @@ import os
 
 import rift.package.store as store
 import rift.package.package
+import rift.package.icon as icon
 
 from .base import AbstractPackageManagerProxy
 
@@ -101,8 +102,15 @@ class FileSystemProxy(AbstractPackageManagerProxy):
         path = store._get_package_dir(package_id)
         dest_file = os.path.join(path, package.prefix, package_path)
 
+        # Insert (by copy) the file in the package location. For icons, 
+        # insert also in UI location for UI to pickup
         try:
             package.insert_file(new_file, dest_file, package_path, mode=mode)
+
+            if package_file_type == 'icons': 
+                icon_extract = icon.PackageIconExtractor(self.log) 
+                icon_extract.extract_icons(package)
+
         except rift.package.package.PackageAppendError as e:
             self.log.exception(e)
             return False
index 56dd404..5c3303f 100644 (file)
@@ -56,8 +56,9 @@ class EndpointDiscoveryRpcHandler(mano_dts.AbstractRpcHandler):
     def callback(self, ks_path, msg):
         """Forwards the request to proxy.
         """
+        
         url = yield from self.proxy.endpoint(
-                msg.package_type,
+                msg.package_type if msg.has_field('package_type') else "",
                 msg.package_id)
 
         rpc_op = RPC_PKG_ENDPOINT.from_dict({"endpoint": url})