diff --git a/app/ceph.py b/app/ceph.py index f982802..ac57f08 100644 --- a/app/ceph.py +++ b/app/ceph.py @@ -17,7 +17,6 @@ def setup(ceph_url, ssh_username): subprocess.check_output(command.split()) except Exception: p = subprocess.check_output(f"ssh-keyscan {ceph_url}".split()) - keys = p.decode("utf-8").split("\n") + keys = p.decode("utf-8").strip().split("\n") with open(os.path.expanduser("~/.ssh/known_hosts"), "a") as known_hosts: - for key in keys: - known_hosts.write(key) \ No newline at end of file + known_hosts.writelines(keys) \ No newline at end of file