diff --git a/app/ceph.py b/app/ceph.py index a921db6..6ae26fc 100644 --- a/app/ceph.py +++ b/app/ceph.py @@ -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)