X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fvim-emu.git;a=blobdiff_plain;f=src%2Femuvim%2Fapi%2Fopenstack%2Fresources%2Fport_chain.py;h=7dcd834239061821d9ca9eb5aaec01d7a016e34d;hp=dfdd2d357584a6bb7f7a960b75ebd754bd1b8e08;hb=ce776393dccaf31ad47f21b06dcf0a2ba56b4874;hpb=72f09885db3935e77901c3dee132cb176b927c7b diff --git a/src/emuvim/api/openstack/resources/port_chain.py b/src/emuvim/api/openstack/resources/port_chain.py index dfdd2d3..7dcd834 100644 --- a/src/emuvim/api/openstack/resources/port_chain.py +++ b/src/emuvim/api/openstack/resources/port_chain.py @@ -71,20 +71,17 @@ class PortChain(object): server_ingress = None server_egress = None for server in compute.computeUnits.values(): - if port_pair.ingress.name in server.port_names: + if port_pair.ingress.name in server.port_names or port_pair.ingress.id in server.port_names: server_ingress = server - elif port_pair.egress.name in server.port_names: + if port_pair.egress.name in server.port_names or port_pair.egress.id in server.port_names: server_egress = server - # TODO: Not sure, if this should throw an error if not server_ingress: - logging.warn("Neutron SFC: ingress port %s not connected." % str( - port_pair.ingress.name)) - continue + raise RuntimeError("Neutron SFC: ingress port %s not connected to any server." % + port_pair.ingress.name) if not server_egress: - logging.warn("Neutron SFC: egress port %s not connected." % str( - port_pair.egress.name)) - continue + raise RuntimeError("Neutron SFC: egress port %s not connected to any server." % + port_pair.egress.name) compute.dc.net.setChain( server_ingress.name, server_egress.name,