Revision f14a8b15 qa/qa_utils.py
b/qa/qa_utils.py | ||
---|---|---|
191 | 191 |
return rcode |
192 | 192 |
|
193 | 193 |
|
194 |
def GetSSHCommand(node, cmd, strict=True, opts=None, tty=True):
|
|
194 |
def GetSSHCommand(node, cmd, strict=True, opts=None, tty=None):
|
|
195 | 195 |
"""Builds SSH command to be executed. |
196 | 196 |
|
197 | 197 |
@type node: string |
... | ... | |
203 | 203 |
@param strict: whether to enable strict host key checking |
204 | 204 |
@type opts: list |
205 | 205 |
@param opts: list of additional options |
206 |
@type tty: Bool
|
|
207 |
@param tty: If we should use tty
|
|
206 |
@type tty: boolean or None
|
|
207 |
@param tty: if we should use tty; if None, will be auto-detected
|
|
208 | 208 |
|
209 | 209 |
""" |
210 | 210 |
args = ["ssh", "-oEscapeChar=none", "-oBatchMode=yes", "-l", "root"] |
211 | 211 |
|
212 |
if tty is None: |
|
213 |
tty = sys.stdout.isatty() |
|
214 |
|
|
212 | 215 |
if tty: |
213 | 216 |
args.append("-t") |
214 | 217 |
|
... | ... | |
275 | 278 |
utils.RemoveFile(sname) |
276 | 279 |
|
277 | 280 |
|
278 |
def GetCommandOutput(node, cmd, tty=True):
|
|
281 |
def GetCommandOutput(node, cmd, tty=None):
|
|
279 | 282 |
"""Returns the output of a command executed on the given node. |
280 | 283 |
|
281 | 284 |
""" |
Also available in: Unified diff