X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=rwlaunchpad%2Fplugins%2Frwpkgmgr%2Frift%2Ftasklets%2Frwpkgmgr%2Frwpkgmgr.py;h=5773b0e5ed48ff454c185ce3a757d9414a1e145b;hb=ffd2636644e9e62b42ddcb1dbe2c4a6e77507a70;hp=b302b46e3d5527803849b653a332ca83d88fc814;hpb=7295f64eb5dd9d75b1dd272567c99304b65a7d0a;p=osm%2FSO.git diff --git a/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/rwpkgmgr.py b/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/rwpkgmgr.py index b302b46e..5773b0e5 100644 --- a/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/rwpkgmgr.py +++ b/rwlaunchpad/plugins/rwpkgmgr/rift/tasklets/rwpkgmgr/rwpkgmgr.py @@ -50,33 +50,42 @@ class PackageManagerTasklet(rift.tasklets.Tasklet): self.log.exception(e) def start(self): - super().start() self.log.debug("Registering with dts") - self.dts = rift.tasklets.DTS( + try: + super().start() + self.dts = rift.tasklets.DTS( self.tasklet_info, RwPkgMgmtYang.get_schema(), self.loop, self.on_dts_state_change ) + + proxy = filesystem.FileSystemProxy(self.loop, self.log) + args = [self.log, self.dts, self.loop] - proxy = filesystem.FileSystemProxy(self.loop, self.log) - - args = [self.log, self.dts, self.loop] - self.job_handler = pkg_publisher.DownloadStatusPublisher(*args) + # create catalog publishers + self.job_handler = pkg_publisher.DownloadStatusPublisher(*args) + self.copy_publisher = pkg_publisher.CopyStatusPublisher(*args +[self.tasklet_info]) # create catalog subscribers - self.vnfd_catalog_sub = subscriber.VnfdStatusSubscriber(*args) - self.nsd_catalog_sub = subscriber.NsdStatusSubscriber(*args) + self.vnfd_catalog_sub = subscriber.VnfdStatusSubscriber(*args) + self.nsd_catalog_sub = subscriber.NsdStatusSubscriber(*args) + + args.append(proxy) + self.endpoint_rpc = rpc.EndpointDiscoveryRpcHandler(*args) + self.schema_rpc = rpc.SchemaRpcHandler(*args) + self.delete_rpc = rpc.PackageDeleteOperationsRpcHandler(*args) + self.copy_rpc = rpc.PackageCopyOperationsRpcHandler(*(args + [self.copy_publisher])) - args.append(proxy) - self.endpoint_rpc = rpc.EndpointDiscoveryRpcHandler(*args) - self.schema_rpc = rpc.SchemaRpcHandler(*args) - self.delete_rpc = rpc.PackageDeleteOperationsRpcHandler(*args) + args.append(self.job_handler) + self.pkg_op = rpc.PackageOperationsRpcHandler(*args) - args.append(self.job_handler) - self.pkg_op = rpc.PackageOperationsRpcHandler(*args) + except Exception as e: + self.log.error("Exception caught rwpkgmgr start: %s", str(e)) + else: + self.log.debug("rwpkgmgr started successfully!") def stop(self): try: @@ -86,13 +95,18 @@ class PackageManagerTasklet(rift.tasklets.Tasklet): @asyncio.coroutine def init(self): - yield from self.endpoint_rpc.register() - yield from self.schema_rpc.register() - yield from self.pkg_op.register() - yield from self.job_handler.register() - yield from self.delete_rpc.register() - yield from self.vnfd_catalog_sub.register() - yield from self.nsd_catalog_sub.register() + try: + yield from self.endpoint_rpc.register() + yield from self.schema_rpc.register() + yield from self.pkg_op.register() + yield from self.job_handler.register() + yield from self.delete_rpc.register() + yield from self.copy_rpc.register() + yield from self.copy_publisher.register() + yield from self.vnfd_catalog_sub.register() + yield from self.nsd_catalog_sub.register() + except Exception as e: + self.log.error("Exception caught rwpkgmgr init %s", str(e)) @asyncio.coroutine def run(self):