From: garciaale Date: Tue, 24 Nov 2020 15:44:21 +0000 (-0300) Subject: Saves and restores VNFD storage and compute data to workaround Pyangbind issue with... X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F10024%2F1;p=osm%2FNBI.git Saves and restores VNFD storage and compute data to workaround Pyangbind issue with lost uint data Change-Id: Ie8db8354fd016c9a43bfc011149485747a67f186 Signed-off-by: garciaale --- diff --git a/osm_nbi/descriptor_topics.py b/osm_nbi/descriptor_topics.py index c752c6c..4e056f5 100644 --- a/osm_nbi/descriptor_topics.py +++ b/osm_nbi/descriptor_topics.py @@ -457,12 +457,18 @@ class VnfdTopic(DescriptorTopic): 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)),