Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
snf-ganeti
Commits
8f07f831
Commit
8f07f831
authored
Mar 18, 2008
by
Michael Hanselmann
Browse files
Add “tty” parameter to SshRunner.BuildCmd
This allows callers to allocate a pseudo-TTY easily. Reviewed-by: ultrotter
parent
bf3d57b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/ssh.py
View file @
8f07f831
...
...
@@ -90,7 +90,8 @@ class SshRunner:
"""Wrapper for SSH commands.
"""
def
BuildCmd
(
self
,
hostname
,
user
,
command
,
batch
=
True
,
ask_key
=
False
):
def
BuildCmd
(
self
,
hostname
,
user
,
command
,
batch
=
True
,
ask_key
=
False
,
tty
=
False
):
"""Build an ssh command to execute a command on a remote node.
Args:
...
...
@@ -114,6 +115,8 @@ class SshRunner:
argv
.
extend
(
BATCH_MODE_OPTS
)
elif
ask_key
:
argv
.
extend
(
ASK_KEY_OPTS
)
if
tty
:
argv
.
append
(
"-t"
)
argv
.
extend
([
"%s@%s"
%
(
user
,
hostname
),
command
])
return
argv
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment