Revision 54ab6aec
b/lib/ssh.py | ||
---|---|---|
133 | 133 |
argv.extend(["%s@%s" % (user, hostname), command]) |
134 | 134 |
return argv |
135 | 135 |
|
136 |
def Run(self, hostname, user, command, batch=True, ask_key=False, |
|
137 |
use_cluster_key=True): |
|
136 |
def Run(self, *args, **kwargs): |
|
138 | 137 |
"""Runs a command on a remote node. |
139 | 138 |
|
140 | 139 |
This method has the same return value as `utils.RunCmd()`, which it |
141 | 140 |
uses to launch ssh. |
142 | 141 |
|
143 | 142 |
Args: |
144 |
hostname: the target host, string |
|
145 |
user: user to auth as |
|
146 |
command: the command |
|
147 |
batch: if true, ssh will run in batch mode with no prompting |
|
148 |
ask_key: if true, ssh will run with StrictHostKeyChecking=ask, so that |
|
149 |
we can connect to an unknown host (not valid in batch mode) |
|
143 |
See SshRunner.BuildCmd. |
|
150 | 144 |
|
151 | 145 |
Returns: |
152 | 146 |
`utils.RunResult` like `utils.RunCmd()` |
153 | 147 |
|
154 | 148 |
""" |
155 |
return utils.RunCmd(self.BuildCmd(hostname, user, command, batch=batch, |
|
156 |
ask_key=ask_key, |
|
157 |
use_cluster_key=use_cluster_key)) |
|
149 |
return utils.RunCmd(self.BuildCmd(*args, **kwargs)) |
|
158 | 150 |
|
159 | 151 |
def CopyFileToNode(self, node, filename): |
160 | 152 |
"""Copy a file to another node with scp. |
Also available in: Unified diff