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')