diff --git a/jsk_data/src/jsk_data/cli.py b/jsk_data/src/jsk_data/cli.py index 3ae814a4f..e81a12b50 100644 --- a/jsk_data/src/jsk_data/cli.py +++ b/jsk_data/src/jsk_data/cli.py @@ -83,7 +83,11 @@ def _list_aries_files(query=None, ls_options=None): cmd = 'ls {opt} {dir}/private/{q}' cmd = cmd.format(opt=' '.join(ls_options), dir=DATA_DIR, q=query) _, stdout, _ = ssh.exec_command(cmd) - files = stdout.read().splitlines() + output = stdout.read() + if isinstance(output, bytes): # Python 3 + files = output.decode('utf-8').splitlines() + else: + files = output.splitlines() return files diff --git a/jsk_data/src/jsk_data/ssh.py b/jsk_data/src/jsk_data/ssh.py index 54c0924c9..6799916a8 100644 --- a/jsk_data/src/jsk_data/ssh.py +++ b/jsk_data/src/jsk_data/ssh.py @@ -16,6 +16,7 @@ def _connect_ssh_context(host, username, password): try: ssh = paramiko.SSHClient() ssh.load_host_keys(os.path.expanduser('~/.ssh/known_hosts')) + ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # Automatically add the host key ssh.connect(host, username=username, password=password) yield ssh finally: