self.log.debug(log_msg)
if action == RwDts.QueryAction.UPDATE:
actionCreate(self, msg)
-
- elif action == RwDts.QueryAction.DELETE:
- actionDelete(self, msg)
+ else:
+ self.log.debug("VnfdStatusSubscriber: No action for ", action)
+ pass
def get_xpath(self):
return self.subscriber.get_xpath()
self.log.debug(log_msg)
if action == RwDts.QueryAction.UPDATE:
actionCreate(self, msg)
-
- elif action == RwDts.QueryAction.DELETE:
- actionDelete(self, msg)
+ else:
+ self.log.debug("NsdStatusSubscriber: No action for ", action)
+ pass
def get_xpath(self):
return self.subscriber.get_xpath()
Serialize the Vnfd/Nsd object to yaml and store yaml file in the created folder.
'''
- download_dir = os.path.join(descriptor.DOWNLOAD_DIR, msg.id, msg.name)
-
+ desc_name = msg.name if msg.name else ""
+ download_dir = os.path.join(descriptor.DOWNLOAD_DIR, msg.id, desc_name)
+
if not os.path.exists(download_dir):
os.makedirs(download_dir)
descriptor.log.debug("Created directory {}".format(download_dir))
with open(yaml_path,"w") as fh:
fh.write(msg.to_yaml(model))
-def actionDelete(descriptor, msg):
- ''' Delete folder structure created above.
- '''
-
- download_dir = os.path.join(descriptor.DOWNLOAD_DIR, msg.id)
- if os.path.exists(download_dir):
- descriptor.log.debug("Removing directory {}".format(download_dir))
- shutil.rmtree(download_dir)
-