Merge "Use show_floatingip method instead of get_floatingip"

This commit is contained in:
Zuul 2018-11-15 06:39:55 +00:00 committed by Gerrit Code Review
commit 840f6279e6
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)