From 1e645a4217078c96f5ee09a437be63f7356157a7 Mon Sep 17 00:00:00 2001 From: schillinge Date: Thu, 31 Jan 2019 08:55:33 +0100 Subject: [PATCH] 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 --- src/emuvim/api/openstack/resources/port_chain.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.25.1