From 4071161f3860dbceb091913d46adbb804d9c6893 Mon Sep 17 00:00:00 2001
From: Vishvananda Ishaya <vishvananda@gmail.com>
Date: Mon, 19 Mar 2012 07:56:07 -0700
Subject: [PATCH] Stop notifications from old leases

 * Fixes performance issue with lots of instances
 * Also removes some commented out code
 * Fixes bug 959356

Change-Id: I6e4cf3cd6ebe9d5d1ae4fc2472ef1765d13f49f6
---
 bin/nova-dhcpbridge | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/bin/nova-dhcpbridge b/bin/nova-dhcpbridge
index ae77fc7b1db4..e9b822c8a993 100755
--- a/bin/nova-dhcpbridge
+++ b/bin/nova-dhcpbridge
@@ -63,9 +63,11 @@ def add_lease(mac, ip_address):
 
 
 def old_lease(mac, ip_address):
-    """Update just as add lease."""
-    LOG.debug(_("Adopted old lease or got a change of mac"))
-    add_lease(mac, ip_address)
+    """Called when an old lease is recognized."""
+    # NOTE(vish): We assume we heard about this lease the first time.
+    #             If not, we will get it the next time the lease is
+    #             renewed.
+    pass
 
 
 def del_lease(mac, ip_address):
@@ -100,12 +102,6 @@ def main():
     if int(os.environ.get('TESTING', '0')):
         from nova.tests import fake_flags
 
-    #if FLAGS.fake_rabbit:
-    #    LOG.debug(_("leasing ip"))
-    #    network_manager = utils.import_object(FLAGS.network_manager)
-    ##    reload(fake_flags)
-    #    from nova.tests import fake_flags
-
     action = argv[1]
     if action in ['add', 'del', 'old']:
         mac = argv[2]