Merge "vnffg-create failed abnormally due to invalid network_src_port_id"

This commit is contained in:
Zuul 2019-02-25 12:55:31 +00:00 committed by Gerrit Code Review
commit cf63a074d2
2 changed files with 10 additions and 5 deletions

View File

@ -278,6 +278,10 @@ class UpdateVnffgException(exceptions.TackerException):
message = _("%(message)s")
class FlowClassiferCreationFailed(exceptions.TackerException):
message = _("%(message)s")
NAME_MAX_LEN = 255
RESOURCE_ATTRIBUTE_MAP = {

View File

@ -840,12 +840,13 @@ class NeutronClient(object):
def flow_classifier_create(self, fc_dict):
LOG.debug("fc_dict passed is {fc_dict}".format(fc_dict=fc_dict))
fc = self.client.create_sfc_flow_classifier(
{'flow_classifier': fc_dict})
if fc:
try:
fc = self.client.create_sfc_flow_classifier(
{'flow_classifier': fc_dict})
return fc['flow_classifier']['id']
else:
return None
except Exception as ex:
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):
update_fc_dict = {'flow_classifier': update_fc}