from .xlate import XLATOR
-__version__ = '0.3.1'
+__version__ = '0.3.2'
LOG = logging.getLogger(__name__)
raise TypeError(msg)
cmds.append(c)
+ cmd_str = ' '.join(map(lambda x: pipes.quote(x), cmds))
+ return self.exec_ssh(cmd_str)
+
+ # -------------------------------------------------------------------------
+ def exec_ssh(self, cmd):
+
ssh = None
proc = None
self.host, port=self.ssh_port, timeout=self.ssh_timeout,
username=self.ssh_user, key_filename=self.private_ssh_key)
- cmd_str = ' '.join(map(lambda x: pipes.quote(x), cmds))
if self.verbose > 1:
- LOG.debug(_("Executing: {}").format(cmd_str))
+ LOG.debug(_("Executing: {!r}").format(cmd))
- stdin, stdout, stderr = ssh.exec_command(cmd_str, timeout=self.ssh_timeout)
+ stdin, stdout, stderr = ssh.exec_command(cmd, timeout=self.ssh_timeout)
end_dt = datetime.datetime.now()
retcode = stdout.channel.recv_exit_status()