Also compare ids against a server's ports 56/7156/5
authorschillinge <ablu@mail.uni-paderborn.de>
Thu, 31 Jan 2019 07:55:33 +0000 (08:55 +0100)
committerschillinge <ablu@mail.uni-paderborn.de>
Wed, 6 Feb 2019 09:17:03 +0000 (10:17 +0100)
The server's port list may contain ids, thus those also need to be
compared.

Change-Id: I2e53c111a22009b6c791abc9e52f28afa96d5b0a
Signed-off-by: schillinge <ablu@mail.uni-paderborn.de>
src/emuvim/api/openstack/resources/port_chain.py

index dfdd2d3..f712312 100644 (file)
@@ -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