From: schillinge Date: Thu, 31 Jan 2019 07:55:33 +0000 (+0100) Subject: Also compare ids against a server's ports X-Git-Tag: v6.0.0~36 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F7156%2F5;p=osm%2Fvim-emu.git Also compare ids against a server's ports The server's port list may contain ids, thus those also need to be compared. Change-Id: I2e53c111a22009b6c791abc9e52f28afa96d5b0a Signed-off-by: schillinge --- diff --git a/src/emuvim/api/openstack/resources/port_chain.py b/src/emuvim/api/openstack/resources/port_chain.py index dfdd2d3..f712312 100644 --- a/src/emuvim/api/openstack/resources/port_chain.py +++ b/src/emuvim/api/openstack/resources/port_chain.py @@ -71,9 +71,9 @@ 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: + elif 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