]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove default root_helper of sudo for remotefs
authorWalter A. Boring IV <walter.boring@hp.com>
Fri, 20 Sep 2013 17:33:54 +0000 (10:33 -0700)
committerWalter A. Boring IV <walter.boring@hp.com>
Fri, 20 Sep 2013 17:33:54 +0000 (10:33 -0700)
This patch removes the default root_helper of sudo
for the RemoteFsClient.  We should be using the
cinder.utils.get_root_helper()

Fixes Bug #1223879

Change-Id: I8ba61cd6ac09b85b9ca924a9cf43c2dcea8e6c15

cinder/brick/initiator/connector.py
cinder/brick/remotefs/remotefs.py
cinder/tests/brick/test_brick_remotefs.py
cinder/volume/drivers/nfs.py

index f31d5968d9557f1b34b4f7edf6f4100050055ab1..ae78c24a965d21642d6ca2e024689f54c72bf442 100644 (file)
@@ -780,8 +780,8 @@ class RemoteFsConnector(InitiatorConnector):
 
     def __init__(self, mount_type, root_helper, driver=None,
                  execute=putils.execute, *args, **kwargs):
-        self._remotefsclient = remotefs.RemoteFsClient(mount_type,
-                                                       execute, root_helper)
+        self._remotefsclient = remotefs.RemoteFsClient(mount_type, root_helper,
+                                                       execute=execute)
         super(RemoteFsConnector, self).__init__(root_helper, driver=driver,
                                                 execute=execute, *args,
                                                 **kwargs)
index 8812bd6ed8b375a91ba0a1f841e0e27d59981364..73e3c3ccae7ba56ee88a8a85a19e427ab1db64c3 100644 (file)
@@ -48,8 +48,8 @@ CONF.register_opts(remotefs_client_opts)
 
 class RemoteFsClient(object):
 
-    def __init__(self, mount_type, execute=putils.execute,
-                 root_helper="sudo", *args, **kwargs):
+    def __init__(self, mount_type, root_helper,
+                 execute=putils.execute, *args, **kwargs):
 
         self._mount_type = mount_type
         if mount_type == "nfs":
index 88d0243abd0461bd896a6d80521ef825fa739c70..7bd28e2a386c97aa62dcdb730c8d29055a3473e5 100644 (file)
@@ -34,7 +34,7 @@ class BrickRemoteFsTestCase(test.TestCase):
     def setUp(self):
         super(BrickRemoteFsTestCase, self).setUp()
         self._mox = mox.Mox()
-        self._nfsclient = remotefs.RemoteFsClient('nfs')
+        self._nfsclient = remotefs.RemoteFsClient('nfs', 'sudo')
         self._nfsclient._mount_options = None
         self._nfsclient._mount_base = self.TEST_MNT_BASE
         self.addCleanup(self._mox.UnsetStubs)
index c9e3b8c7ec9fbcbd2e3299167c337b6f1f4aa18c..2e58e94300ebdb0ebf3cb44ab3d42aca307e3c14 100644 (file)
@@ -26,6 +26,7 @@ from cinder.image import image_utils
 from cinder.openstack.common import log as logging
 from cinder.openstack.common import processutils as putils
 from cinder import units
+from cinder import utils
 from cinder.volume import driver
 
 VERSION = '1.1.0'
@@ -359,7 +360,9 @@ class NfsDriver(RemoteFsDriver):
         self._remotefsclient = None
         super(NfsDriver, self).__init__(*args, **kwargs)
         self.configuration.append_config_values(volume_opts)
-        self._remotefsclient = remotefs.RemoteFsClient('nfs', execute)
+        root_helper = utils.get_root_helper()
+        self._remotefsclient = remotefs.RemoteFsClient('nfs', root_helper,
+                                                       execute=execute)
 
     def set_execute(self, execute):
         super(NfsDriver, self).set_execute(execute)