Commit 7bff16bd authored by Iustin Pop's avatar Iustin Pop

setup-ssh: only read the ssh port once

Then reuse it. With certain setups, this could be slow when pre-seeding
an entire cluster.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 8647a52c
......@@ -220,6 +220,7 @@ def main():
SetupLogging(options)
passwd = getpass.getpass(prompt="%s password:" % constants.GANETI_RUNAS)
ssh_port = netutils.GetDaemonPort("ssh")
# Below, we need to join() the transport objects, as otherwise the
# following happens:
......@@ -231,7 +232,7 @@ def main():
# now
for host in args:
transport = paramiko.Transport((host, netutils.GetDaemonPort("ssh")))
transport = paramiko.Transport((host, ssh_port))
try:
transport.connect(username=constants.GANETI_RUNAS, password=passwd)
except Exception, err:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment