This commit is contained in:
ahmadbilalkhalid 2019-08-29 17:57:24 +05:00
parent b889dfadb4
commit fcd7e9220b

View file

@ -12,10 +12,10 @@ def ceph():
@click.option("--ssh_username", required=True)
def setup(ceph_url, ssh_username):
ssh_key = ""
with open("~/.ssh/id_rsa.pub") as pubkey:
with open(os.path.expanduser("~/.ssh/id_rsa.pub")) as pubkey:
ssh_key = pubkey.read()
with open("~/.ssh/known_hosts", "a") as known_hosts:
with open(os.path.expanduser("~/.ssh/known_hosts"), "a") as known_hosts:
known_hosts.write(f"{ceph_url} {ssh_key}")
os.makedirs("/etc/ceph", exist_ok=True)