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