]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Fix log message for unreferenced variable
authorGary Kotton <gkotton@redhat.com>
Tue, 18 Dec 2012 13:40:38 +0000 (13:40 +0000)
committerGary Kotton <gkotton@redhat.com>
Wed, 19 Dec 2012 13:36:31 +0000 (13:36 +0000)
Fixed bug 1091664

Change-Id: I83110fd8d05d8a5168cbc21ce78c3c44d01c7ae1

quantum/plugins/openvswitch/ovs_db_v2.py
quantum/tests/unit/openvswitch/test_ovs_db.py

index 27dea91ec3f7b7f55af6ee7dd4ab0be40453ce85..68a617b41e9da29c958f5f2d4de6e0926ad4b764 100644 (file)
@@ -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)
 
 
index b707c5a9718a4b18b5393b9cb87caa88b1d389aa..3685e34a626ef8abbab4f9497586480aebba547a 100644 (file)
@@ -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):