Merge "Fix bug to run command as root in HDFS driver"
This commit is contained in:
commit
4795f7c80e
@ -107,7 +107,7 @@ class HDFSNativeShareDriver(driver.ExecuteMixin, driver.ShareDriver):
|
||||
|
||||
def _hdfs_local_execute(self, *cmd, **kwargs):
|
||||
if 'run_as_root' not in kwargs:
|
||||
kwargs.update({'run_as_root': True})
|
||||
kwargs.update({'run_as_root': False})
|
||||
|
||||
return utils.execute(*cmd, **kwargs)
|
||||
|
||||
|
@ -358,7 +358,7 @@ class HDFSNativeShareDriverTestCase(test.TestCase):
|
||||
cmd = 'testcmd'
|
||||
self.mock_object(utils, 'execute', mock.Mock(return_value=True))
|
||||
self._driver._hdfs_local_execute(cmd)
|
||||
utils.execute.assert_called_once_with(cmd, run_as_root=True)
|
||||
utils.execute.assert_called_once_with(cmd, run_as_root=False)
|
||||
|
||||
def test__hdfs_remote_execute(self):
|
||||
self._driver._run_ssh = mock.Mock(return_value=True)
|
||||
|
Loading…
Reference in New Issue
Block a user