vnffg-create failed abnormally due to invalid network_src_port_id
When create a vnffg with a non-existent network_src_port_id in vnffgd, create command failed abnormally with "internal server error". This patch will handle the issue and raise FlowClassifierPortNotFound exception. Partially Implements: blueprint improve-return-message Closes-bug: #1710633 Change-Id: If9c36cb260d43bec515a52b93e10f714d063dc92
This commit is contained in:
parent
48a5f80be7
commit
ae8f8c7d9d
@ -278,6 +278,10 @@ class UpdateVnffgException(exceptions.TackerException):
|
|||||||
message = _("%(message)s")
|
message = _("%(message)s")
|
||||||
|
|
||||||
|
|
||||||
|
class FlowClassiferCreationFailed(exceptions.TackerException):
|
||||||
|
message = _("%(message)s")
|
||||||
|
|
||||||
|
|
||||||
NAME_MAX_LEN = 255
|
NAME_MAX_LEN = 255
|
||||||
|
|
||||||
RESOURCE_ATTRIBUTE_MAP = {
|
RESOURCE_ATTRIBUTE_MAP = {
|
||||||
|
@ -840,12 +840,13 @@ class NeutronClient(object):
|
|||||||
|
|
||||||
def flow_classifier_create(self, fc_dict):
|
def flow_classifier_create(self, fc_dict):
|
||||||
LOG.debug("fc_dict passed is {fc_dict}".format(fc_dict=fc_dict))
|
LOG.debug("fc_dict passed is {fc_dict}".format(fc_dict=fc_dict))
|
||||||
fc = self.client.create_sfc_flow_classifier(
|
try:
|
||||||
{'flow_classifier': fc_dict})
|
fc = self.client.create_sfc_flow_classifier(
|
||||||
if fc:
|
{'flow_classifier': fc_dict})
|
||||||
return fc['flow_classifier']['id']
|
return fc['flow_classifier']['id']
|
||||||
else:
|
except Exception as ex:
|
||||||
return None
|
LOG.error("Error while creating Flow Classifier: %s", str(ex))
|
||||||
|
raise nfvo.FlowClassiferCreationFailed(message=str(ex))
|
||||||
|
|
||||||
def flow_classifier_update(self, fc_id, update_fc):
|
def flow_classifier_update(self, fc_id, update_fc):
|
||||||
update_fc_dict = {'flow_classifier': update_fc}
|
update_fc_dict = {'flow_classifier': update_fc}
|
||||||
|
Loading…
Reference in New Issue
Block a user