This commit is contained in:
ahmadbilalkhalid 2019-08-29 18:37:44 +05:00
parent a7a04f6b40
commit a60507a215

View file

@ -18,6 +18,6 @@ def setup(ceph_url, ssh_username):
except Exception: except Exception:
p = subprocess.check_output(f"ssh-keyscan {ceph_url}".split()) p = subprocess.check_output(f"ssh-keyscan {ceph_url}".split())
keys = p.decode("utf-8").strip().split("\n") keys = p.decode("utf-8").strip().split("\n")
print(keys) keys = "\n".join(keys)
with open(os.path.expanduser("~/.ssh/known_hosts"), "a") as known_hosts: with open(os.path.expanduser("~/.ssh/known_hosts"), "a") as known_hosts:
known_hosts.writelines(keys) known_hosts.write(keys)