From: Peter Wienemann Date: Tue, 11 Jun 2013 19:38:51 +0000 (+0200) Subject: ceph-create-keys: Make sure directories for admin and bootstrap keys exist X-Git-Tag: v0.65~102 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1577e203f08c3f94c36fd128dda14e8bceeca7a9;p=ceph.git ceph-create-keys: Make sure directories for admin and bootstrap keys exist Signed-off-by: Peter Wienemann --- diff --git a/src/ceph-create-keys b/src/ceph-create-keys index 437b7b207fdd..176b06e7a380 100755 --- a/src/ceph-create-keys +++ b/src/ceph-create-keys @@ -65,6 +65,9 @@ def get_key(cluster, mon_id): path=path, pid=os.getpid(), ) + pathdir = os.path.dirname(path) + if not os.path.exists(pathdir): + os.makedirs(pathdir) while True: try: with file(tmp, 'w') as f: @@ -131,6 +134,10 @@ def bootstrap_key(cluster, type_): 'allow profile bootstrap-{type}'.format(type=type_), ] + pathdir = os.path.dirname(path) + if not os.path.exists(pathdir): + os.makedirs(pathdir) + while True: try: with file(tmp, 'w') as f: