- for nsd in self.yangs[self.NSD]:
- self.log.debug(_("Translate descriptor of type nsd: {}").
- format(nsd))
- tosca_node = TranslateDescriptors. \
- YANG_TO_TOSCA_TYPE[self.NSD](
- self.log,
- nsd.pop(ToscaResource.NAME),
- self.NSD,
- nsd)
- self.tosca_resources.append(tosca_node)
-
- for vnfd in self.yangs[self.VNFD]:
- self.log.debug(_("Translate descriptor of type vnfd: {}").
- format(vnfd))
- tosca_node = TranslateDescriptors. \
- YANG_TO_TOSCA_TYPE[self.VNFD](
- self.log,
- vnfd.pop(ToscaResource.NAME),
- self.VNFD,
- vnfd)
- self.tosca_resources.append(tosca_node)
+ if self.NSD in self.yangs:
+ for nsd in self.yangs[self.NSD]:
+ self.log.debug(_("Translate descriptor of type nsd: {}").
+ format(nsd))
+ tosca_node = TranslateDescriptors. \
+ YANG_TO_TOSCA_TYPE[self.NSD](
+ self.log,
+ nsd.pop(ToscaResource.NAME),
+ self.NSD,
+ nsd,
+ self.vnfd_files)
+ self.tosca_resources.append(tosca_node)
+
+ if self.VNFD in self.yangs:
+ for vnfd in self.yangs[self.VNFD]:
+ self.log.debug(_("Translate descriptor of type vnfd: {}").
+ format(vnfd))
+ tosca_node = TranslateDescriptors. \
+ YANG_TO_TOSCA_TYPE[self.VNFD](
+ self.log,
+ vnfd.pop(ToscaResource.NAME),
+ self.VNFD,
+ vnfd)
+ self.tosca_resources.append(tosca_node)