diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-10-25 08:45:40 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-10-25 08:45:40 +0000 |
| commit | a6b89fc522e59f08e4114e5547f484f8b2540eb4 (patch) | |
| tree | 1cc3a2c35e38fa1bdc923f7dc1fa67810c324784 | |
| parent | c6a18f93316a567ad859877ff32a6ac3cb735310 (diff) | |
| parent | cb9b36c94ba1652cf60e45ae1d96ba7bd41e5710 (diff) | |
| download | nova-a6b89fc522e59f08e4114e5547f484f8b2540eb4.tar.gz nova-a6b89fc522e59f08e4114e5547f484f8b2540eb4.tar.xz nova-a6b89fc522e59f08e4114e5547f484f8b2540eb4.zip | |
Merge "SanISCSIDriver SSH execution fixes."
| -rw-r--r-- | nova/utils.py | 4 | ||||
| -rw-r--r-- | nova/volume/san.py | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/nova/utils.py b/nova/utils.py index c69b97ed8..d3bbaeef8 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -249,7 +249,7 @@ def trycmd(*args, **kwargs): def ssh_execute(ssh, cmd, process_input=None, addl_env=None, check_exit_code=True): - LOG.debug(_('Running cmd (SSH): %s'), ' '.join(cmd)) + LOG.debug(_('Running cmd (SSH): %s'), cmd) if addl_env: raise exception.NovaException(_('Environment not supported over SSH')) @@ -279,7 +279,7 @@ def ssh_execute(ssh, cmd, process_input=None, raise exception.ProcessExecutionError(exit_code=exit_status, stdout=stdout, stderr=stderr, - cmd=' '.join(cmd)) + cmd=cmd) return (stdout, stderr) diff --git a/nova/volume/san.py b/nova/volume/san.py index 22147141a..cf4507f31 100644 --- a/nova/volume/san.py +++ b/nova/volume/san.py @@ -86,8 +86,10 @@ class SanISCSIDriver(nova.volume.driver.ISCSIDriver): remote protocol. """ - def __init__(self, *args, **kwargs): - super(SanISCSIDriver, self).__init__(*args, **kwargs) + def __init__(self, execute=None, *args, **kwargs): + if execute is None: + execute = self._execute + super(SanISCSIDriver, self).__init__(execute, *args, **kwargs) self.run_local = FLAGS.san_is_local def _build_iscsi_target_name(self, volume): @@ -119,7 +121,7 @@ class SanISCSIDriver(nova.volume.driver.ISCSIDriver): if self.run_local: return utils.execute(*cmd, **kwargs) else: - check_exit_code = kwargs.pop('check_exit_code', None) + check_exit_code = kwargs.pop('check_exit_code', True) command = ' '.join(cmd) return self._run_ssh(command, check_exit_code) |
