Skip to content

Commit

Permalink
Merge "Remove useless parameter from l3_dvr_db.py"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Dec 25, 2014
2 parents 844a453 + 95504e2 commit 197838b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 6 additions & 6 deletions neutron/db/l3_dvr_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ def update_floatingip(self, context, id, floatingip):
res_fip.get('fixed_port_id'))
if unused_agent_port:
self.clear_unused_fip_agent_gw_port(
admin_ctx, floatingip, fip['id'])
admin_ctx, floatingip)
return res_fip

def clear_unused_fip_agent_gw_port(
self, context, floatingip_db, fip_id):
self, context, floatingip_db):
"""Helper function to check for fip agent gw port and delete.
This function checks on compute nodes to make sure if there
Expand All @@ -184,7 +184,7 @@ def clear_unused_fip_agent_gw_port(
fip_hostid = self.get_vm_port_hostid(
context, floatingip_db['fixed_port_id'])
if fip_hostid and self.check_fips_availability_on_host(
context, fip_id, fip_hostid):
context, fip_hostid):
LOG.debug('Deleting the Agent GW Port on host: %s', fip_hostid)
self.delete_floatingip_agent_gateway_port(context, fip_hostid)

Expand All @@ -193,7 +193,7 @@ def delete_floatingip(self, context, id):
if floatingip['fixed_port_id']:
admin_ctx = context.elevated()
self.clear_unused_fip_agent_gw_port(
admin_ctx, floatingip, id)
admin_ctx, floatingip)
super(L3_NAT_with_dvr_db_mixin,
self).delete_floatingip(context, id)

Expand All @@ -211,7 +211,7 @@ def disassociate_floatingips(self, context, port_id, do_notify=True):
if fip:
admin_ctx = context.elevated()
self.clear_unused_fip_agent_gw_port(
admin_ctx, fip, id)
admin_ctx, fip)
return super(L3_NAT_with_dvr_db_mixin,
self).disassociate_floatingips(context,
port_id,
Expand Down Expand Up @@ -409,7 +409,7 @@ def get_agent_gw_ports_exist_for_network(
if ports:
return ports[0]

def check_fips_availability_on_host(self, context, fip_id, host_id):
def check_fips_availability_on_host(self, context, host_id):
"""Query all floating_ips and filter by particular host."""
fip_count_on_host = 0
with context.session.begin(subtransactions=True):
Expand Down
3 changes: 1 addition & 2 deletions neutron/tests/unit/db/test_l3_dvr_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def test_clear_unused_fip_agent_gw_port(self):
'fixed_port_id': _uuid(),
'floating_network_id': _uuid()
}
fip_id = floatingip['id']
with contextlib.nested(
mock.patch.object(l3_dvr_db.l3_db.L3_NAT_db_mixin,
'_get_floatingip'),
Expand All @@ -200,7 +199,7 @@ def test_clear_unused_fip_agent_gw_port(self):
gvm.return_value = 'my-host'
cfips.return_value = True
self.mixin.clear_unused_fip_agent_gw_port(
self.ctx, floatingip, fip_id)
self.ctx, floatingip)
self.assertTrue(dfips.called)
self.assertTrue(cfips.called)
self.assertTrue(gvm.called)
Expand Down

0 comments on commit 197838b

Please sign in to comment.