]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Register root_helper in test_debug_commands and test_dhcp_agent
authorAlessio Ababilov <aababilov@griddynamics.com>
Wed, 6 Feb 2013 11:22:53 +0000 (13:22 +0200)
committerAlessio Ababilov <aababilov@griddynamics.com>
Wed, 6 Feb 2013 11:22:53 +0000 (13:22 +0200)
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
quantum/tests/unit/test_dhcp_agent.py

index 9e7f7f7ab5c790f0edaccc79c672e659f12a5860..0f5a4d340b43909dac8469a89aaf8d794c344715 100644 (file)
@@ -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(
index c763244f583eb2b285b788c5d4f1720273224890..46cff19f3714cc420a5b7cf021b702d72b295f8f 100644 (file)
@@ -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')