From fcd7e9220ba26c0e9f4246c0a9bdeaa3b7c273a0 Mon Sep 17 00:00:00 2001 From: Ahmed Bilal Khalid Date: Thu, 29 Aug 2019 17:57:24 +0500 Subject: [PATCH] a --- app/ceph.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)