def pyangbind_validation(self, item, data, force=False):
try:
+ virtual_compute_descriptors = data.get('virtual-compute-desc')
+ virtual_storage_descriptors = data.get('virtual-storage-desc')
myvnfd = etsi_nfv_vnfd.etsi_nfv_vnfd()
pybindJSONDecoder.load_ietf_json({'etsi-nfv-vnfd:vnfd': data}, None, None, obj=myvnfd,
path_helper=True, skip_unknown=force)
out = pybindJSON.dumps(myvnfd, mode="ietf")
desc_out = self._remove_envelop(yaml.safe_load(out))
desc_out = self._remove_yang_prefixes_from_descriptor(desc_out)
+ if virtual_compute_descriptors:
+ desc_out['virtual-compute-desc'] = virtual_compute_descriptors
+ if virtual_storage_descriptors:
+ desc_out['virtual-storage-desc'] = virtual_storage_descriptors
return desc_out
except Exception as e:
raise EngineException("Error in pyangbind validation: {}".format(str(e)),