diff --git a/launch/launch-node.py b/launch/launch-node.py index 61b9d5315a..f49c3c498a 100755 --- a/launch/launch-node.py +++ b/launch/launch-node.py @@ -74,7 +74,7 @@ def bootstrap_server(server, key, name, volume_device, keep, ip = server.public_v4 ssh_kwargs = dict(pkey=key) - print 'Public IP', ip + print("--- Running initial configuration on host %s ---" % ip) for username in ['root', 'ubuntu', 'centos', 'admin']: ssh_client = utils.ssh_connect(ip, username, ssh_kwargs, timeout=600) if ssh_client: diff --git a/launch/sshclient.py b/launch/sshclient.py index 49d6bf6359..1c23aafda4 100644 --- a/launch/sshclient.py +++ b/launch/sshclient.py @@ -40,19 +40,23 @@ class SSHClient(object): def ssh(self, command, error_ok=False): stdin, stdout, stderr = self.client.exec_command(command) - print command + print('--- ssh: "%s" ---' % command) + print(' -- stdout --') output = '' for x in stdout: output += x - sys.stdout.write(x) + sys.stdout.write(" | " + x) ret = stdout.channel.recv_exit_status() - print stderr.read() + print(" -- stderr --") + for x in stderr: + sys.stdout.write(" | " + x) if (not error_ok) and ret: raise SSHException("Unable to %s" % command, ret) + print("--- done ---\n") return ret, output def scp(self, source, dest): - print 'copy', source, dest + print('--- scp copy: %s -> %s' % (source, dest)) ftp = self.client.open_sftp() ftp.put(source, dest) ftp.close()