DescriptorTopic.__init__(self, db, fs, msg, auth)
def pyangbind_validation(self, item, data, force=False):
+ if self._descriptor_data_is_in_old_format(data):
+ raise EngineException("ERROR: Unsupported descriptor format. Please, use an ETSI SOL006 descriptor.",
+ http_code=HTTPStatus.UNPROCESSABLE_ENTITY)
try:
virtual_compute_descriptors = data.get('virtual-compute-desc')
virtual_storage_descriptors = data.get('virtual-storage-desc')
raise EngineException("Error in pyangbind validation: {}".format(str(e)),
http_code=HTTPStatus.UNPROCESSABLE_ENTITY)
+ @staticmethod
+ def _descriptor_data_is_in_old_format(data):
+ return ('vnfd-catalog' in data) or ('vnfd:vnfd-catalog' in data)
+
@staticmethod
def _remove_envelop(indata=None):
if not indata:
DescriptorTopic.__init__(self, db, fs, msg, auth)
def pyangbind_validation(self, item, data, force=False):
+ if self._descriptor_data_is_in_old_format(data):
+ raise EngineException("ERROR: Unsupported descriptor format. Please, use an ETSI SOL006 descriptor.",
+ http_code=HTTPStatus.UNPROCESSABLE_ENTITY)
try:
mynsd = etsi_nfv_nsd.etsi_nfv_nsd()
pybindJSONDecoder.load_ietf_json({'nsd': {'nsd': [data]}}, None, None, obj=mynsd,
raise EngineException("Error in pyangbind validation: {}".format(str(e)),
http_code=HTTPStatus.UNPROCESSABLE_ENTITY)
+ @staticmethod
+ def _descriptor_data_is_in_old_format(data):
+ return ('nsd-catalog' in data) or ('nsd:nsd-catalog' in data)
+
@staticmethod
def _remove_envelop(indata=None):
if not indata: