Merge "Fix bug to run command as root in HDFS driver"

This commit is contained in:
Jenkins 2015-08-18 17:22:22 +00:00 committed by Gerrit Code Review
commit 4795f7c80e
2 changed files with 2 additions and 2 deletions

View File

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

View File

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