From f7b4e5444d5c2037382358de032b1bc983a7532d Mon Sep 17 00:00:00 2001 From: Ahmed Bilal Khalid Date: Thu, 29 Aug 2019 18:39:34 +0500 Subject: [PATCH] a --- app/ceph.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/ceph.py b/app/ceph.py index 16f8179..74916a4 100644 --- a/app/ceph.py +++ b/app/ceph.py @@ -20,4 +20,8 @@ def setup(ceph_url, ssh_username): keys = p.decode("utf-8").strip().split("\n") keys = "\n".join(keys) with open(os.path.expanduser("~/.ssh/known_hosts"), "a") as known_hosts: - known_hosts.write(keys) \ No newline at end of file + known_hosts.write(keys) + + os.makedirs("/etc/ceph", exist_ok=True) + command = f"sftp -b ./ceph_batch_cmd {ssh_username}@{ceph_url}:/etc/ceph" + subprocess.check_output(command.split()) \ No newline at end of file