From 3b75915bb399547b73a54b8377ff8a3d4a1695d6 Mon Sep 17 00:00:00 2001 From: Brad Hall Date: Tue, 29 Nov 2011 06:33:19 +0000 Subject: Fix QuantumManager update_dhcp calls The syntax recently changed to add another parameter (context) Change-Id: I984294064f26bd49facd75ca4bf4634c9ff61bc8 --- nova/network/quantum/manager.py | 4 ++-- nova/tests/test_quantum.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/nova/network/quantum/manager.py b/nova/network/quantum/manager.py index 3cf131ddb..418b6de71 100644 --- a/nova/network/quantum/manager.py +++ b/nova/network/quantum/manager.py @@ -304,7 +304,7 @@ class QuantumManager(manager.FlatManager): hosts = self.get_dhcp_hosts_text(context, subnet['network_id'], project_id) self.driver.update_dhcp_hostfile_with_text(dev, hosts) - self.driver.restart_dhcp(dev, network_ref) + self.driver.restart_dhcp(context, dev, network_ref) def add_virtual_interface(self, context, instance_id, network_id): # If we're not using melange, use the default means... @@ -497,7 +497,7 @@ class QuantumManager(manager.FlatManager): self.driver.update_dhcp_hostfile_with_text(dev, hosts) # Restart dnsmasq self.driver.kill_dhcp(dev) - self.driver.restart_dhcp(dev, network_ref) + self.driver.restart_dhcp(context, dev, network_ref) # TODO(bgh): if this is the last instance for the network # then we should actually just kill the dhcp server. diff --git a/nova/tests/test_quantum.py b/nova/tests/test_quantum.py index d5cd09f37..174c512db 100644 --- a/nova/tests/test_quantum.py +++ b/nova/tests/test_quantum.py @@ -261,11 +261,14 @@ class QuantumNovaIPAMTestCase(QuantumNovaTestCase): def func(arg1, arg2): pass + def func2(arg1, arg2, arg3): + pass + def func1(arg1): pass self.net_man.driver.update_dhcp_hostfile_with_text = func - self.net_man.driver.restart_dhcp = func + self.net_man.driver.restart_dhcp = func2 self.net_man.driver.kill_dhcp = func1 nw_info = self.net_man.allocate_for_instance(ctx, instance_id=instance_ref['id'], host="", @@ -320,8 +323,11 @@ class QuantumNovaIPAMTestCase(QuantumNovaTestCase): def func1(arg1): pass + def func2(arg1, arg2, arg3): + pass + self.net_man.driver.update_dhcp_hostfile_with_text = func - self.net_man.driver.restart_dhcp = func + self.net_man.driver.restart_dhcp = func2 self.net_man.driver.kill_dhcp = func1 nw_info = self.net_man.allocate_for_instance(ctx, instance_id=instance_ref['id'], host="", -- cgit