From: Gary Kotton Date: Tue, 18 Dec 2012 13:40:38 +0000 (+0000) Subject: Fix log message for unreferenced variable X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=71a747251a08df1f322ba0c8d34f588a9ec188c8;p=openstack-build%2Fneutron-build.git Fix log message for unreferenced variable Fixed bug 1091664 Change-Id: I83110fd8d05d8a5168cbc21ce78c3c44d01c7ae1 --- diff --git a/quantum/plugins/openvswitch/ovs_db_v2.py b/quantum/plugins/openvswitch/ovs_db_v2.py index 27dea91ec..68a617b41 100644 --- a/quantum/plugins/openvswitch/ovs_db_v2.py +++ b/quantum/plugins/openvswitch/ovs_db_v2.py @@ -111,7 +111,7 @@ def sync_vlan_allocations(network_vlan_ranges): LOG.debug(_("Removing vlan %(vlan_id)s on physical " "network %(physical_network)s from pool"), {'vlan_id': alloc.vlan_id, - 'physical_network': physical_network}) + 'physical_network': alloc.physical_network}) session.delete(alloc) diff --git a/quantum/tests/unit/openvswitch/test_ovs_db.py b/quantum/tests/unit/openvswitch/test_ovs_db.py index b707c5a97..3685e34a6 100644 --- a/quantum/tests/unit/openvswitch/test_ovs_db.py +++ b/quantum/tests/unit/openvswitch/test_ovs_db.py @@ -164,6 +164,19 @@ class VlanAllocationsTest(unittest2.TestCase): ovs_db_v2.release_vlan(self.session, PHYS_NET, vlan_id, VLAN_RANGES) self.assertIsNone(ovs_db_v2.get_vlan_allocation(PHYS_NET, vlan_id)) + def test_sync_with_allocated_false(self): + vlan_ids = set() + for x in xrange(VLAN_MIN, VLAN_MAX + 1): + physical_network, vlan_id = ovs_db_v2.reserve_vlan(self.session) + self.assertEqual(physical_network, PHYS_NET) + self.assertGreaterEqual(vlan_id, VLAN_MIN) + self.assertLessEqual(vlan_id, VLAN_MAX) + vlan_ids.add(vlan_id) + + ovs_db_v2.release_vlan(self.session, PHYS_NET, vlan_ids.pop(), + VLAN_RANGES) + ovs_db_v2.sync_vlan_allocations({}) + class TunnelAllocationsTest(unittest2.TestCase): def setUp(self):