From 48a2feb2f783ab90675ed3905912937f597274c2 Mon Sep 17 00:00:00 2001 From: Alessio Ababilov Date: Wed, 6 Feb 2013 13:22:53 +0200 Subject: [PATCH] Register root_helper in test_debug_commands and test_dhcp_agent root_helper variable currently must be introduced with a call to register_root_helper, not with a simple assignment. Change-Id: I3e72379925a994acfb6defb24820ab63eab43957 Fixes: bug #1117240 --- quantum/tests/unit/test_debug_commands.py | 3 ++- quantum/tests/unit/test_dhcp_agent.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/quantum/tests/unit/test_debug_commands.py b/quantum/tests/unit/test_debug_commands.py index 9e7f7f7ab5..0f5a4d340b 100644 --- a/quantum/tests/unit/test_debug_commands.py +++ b/quantum/tests/unit/test_debug_commands.py @@ -20,6 +20,7 @@ import socket import mock import unittest2 as unittest +from quantum.agent.common import config from quantum.agent.linux import interface from quantum.debug import commands from quantum.debug.debug_agent import DEVICE_OWNER_PROBE, QuantumDebugAgent @@ -37,7 +38,7 @@ class TestDebugCommands(unittest.TestCase): cfg.CONF.register_opts(QuantumDebugAgent.OPTS) cfg.CONF(args=[], project='quantum') cfg.CONF.set_override('use_namespaces', True) - cfg.CONF.root_helper = 'sudo' + config.register_root_helper(cfg.CONF) self.addCleanup(mock.patch.stopall) device_exists_p = mock.patch( diff --git a/quantum/tests/unit/test_dhcp_agent.py b/quantum/tests/unit/test_dhcp_agent.py index c763244f58..46cff19f37 100644 --- a/quantum/tests/unit/test_dhcp_agent.py +++ b/quantum/tests/unit/test_dhcp_agent.py @@ -23,6 +23,7 @@ import uuid import mock import unittest2 as unittest +from quantum.agent.common import config from quantum.agent import dhcp_agent from quantum.agent.linux import interface from quantum.common import exceptions @@ -254,7 +255,7 @@ class TestDhcpAgentEventHandler(unittest.TestCase): cfg.CONF.register_opts(dhcp_agent.DeviceManager.OPTS) cfg.CONF.set_override('interface_driver', 'quantum.agent.linux.interface.NullDriver') - cfg.CONF.root_helper = 'sudo' + config.register_root_helper(cfg.CONF) cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS) self.notification_p = mock.patch( 'quantum.agent.rpc.NotificationDispatcher') @@ -666,7 +667,7 @@ class TestDeviceManager(unittest.TestCase): cfg.CONF.register_opts(dhcp_agent.DhcpAgent.OPTS) cfg.CONF.set_override('interface_driver', 'quantum.agent.linux.interface.NullDriver') - cfg.CONF.root_helper = 'sudo' + config.register_root_helper(cfg.CONF) self.device_exists_p = mock.patch( 'quantum.agent.linux.ip_lib.device_exists')