aboutsummaryrefslogtreecommitdiffstats
path: root/sfc/lib
diff options
context:
space:
mode:
authorManuel Buil <mbuil@suse.com>2018-02-27 18:09:32 +0100
committerManuel Buil <mbuil@suse.com>2018-02-28 18:07:56 +0100
commit39e1f4dba0bc9e6bd1c3bd43b7077c6745635e0c (patch)
tree4cbcceccfc24d52c9d6a7af2bc99762a293959ff /sfc/lib
parent41135da626fe2c2813e58f52928b4e5ba4e47bf7 (diff)
Bug fix: Problem with SNAPs integration
SNAPs changed the API: https://github.com/opnfv/snaps/commit/c711acf8ae3e4ad6f746500747857bcc9fd6f7be#diff-0b922a3e087121238d5a8b08ef5b894aR480 Now we require to pass keystone client to get the neutron port Change-Id: I93fa4b127255c1a078aa3644773b7c8b886cea6d Signed-off-by: Manuel Buil <mbuil@suse.com>
Diffstat (limited to 'sfc/lib')
-rw-r--r--sfc/lib/openstack_utils.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/sfc/lib/openstack_utils.py b/sfc/lib/openstack_utils.py
index 535870da..03aa9cf9 100644
--- a/sfc/lib/openstack_utils.py
+++ b/sfc/lib/openstack_utils.py
@@ -206,13 +206,19 @@ class OpenStackSFC:
return fips
- def get_client_port_id(self, vm):
+ def get_client_port(self, vm, vm_creator):
'''
Get the neutron port id of the client
'''
- port_id = neutron_utils.get_port(self.neutron,
- port_name=vm.name + "-port")
- return port_id
+ port_name = vm.name + "-port"
+ port = vm_creator.get_port_by_name(port_name)
+ if port is not None:
+ return port
+ else:
+ logger.error("The VM {0} does not have any port"
+ " with name {1}".format(vm_name, port_name))
+ raise Exception("Client VM does not have the desired port")
+
# TACKER SECTION #