Use show_floatingip method instead of get_floatingip

get_floatingip does not exist. This patch changes it by
show_floatingip method:
https://github.com/openstack/python-neutronclient/blob/master/neutronclient/v2_0/client.py#L944

Closes-Bug: 1803314
Change-Id: I06df1985d710b92c65345d4ada42e33f427d4a5a
This commit is contained in:
Luis Tomas Bolivar 2018-11-14 10:51:43 +01:00
parent 18e2c822e5
commit 3a6ec33525
2 changed files with 4 additions and 4 deletions

View File

@ -141,7 +141,7 @@ class FipPubIpDriver(BasePubIpDriver):
except n_exc.Conflict:
LOG.warning("Conflict when assigning floating IP with id %s. "
"Checking if it's already assigned correctly.", res_id)
fip = neutron.get_floatingip(res_id)
fip = neutron.show_floatingip(res_id)
used_port_id = fip['port_id']
if used_port_id != vip_port_id:
LOG.exception("Floating IP already used by port %s.",

View File

@ -128,8 +128,8 @@ class TestFipPubIpDriver(test_base.TestCase):
neutron = self.useFixture(k_fix.MockNeutronClient()).client
neutron.update_floatingip.side_effect = n_exc.Conflict
neutron.get_floatingip.return_value = {'id': res_id,
'port_id': vip_port_id}
neutron.show_floatingip.return_value = {'id': res_id,
'port_id': vip_port_id}
self.assertIsNone(driver.associate(res_id, vip_port_id))
def test_associate_conflict_incorrect(self):
@ -139,7 +139,7 @@ class TestFipPubIpDriver(test_base.TestCase):
neutron = self.useFixture(k_fix.MockNeutronClient()).client
neutron.update_floatingip.side_effect = n_exc.Conflict
neutron.get_floatingip.return_value = {'id': res_id, 'port_id': 'foo'}
neutron.show_floatingip.return_value = {'id': res_id, 'port_id': 'foo'}
self.assertRaises(n_exc.Conflict, driver.associate, res_id,
vip_port_id)