]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-create-keys: Make sure directories for admin and bootstrap keys exist
authorPeter Wienemann <wienemann@physik.uni-bonn.de>
Tue, 11 Jun 2013 19:38:51 +0000 (21:38 +0200)
committerSage Weil <sage@inktank.com>
Wed, 12 Jun 2013 15:40:25 +0000 (08:40 -0700)
Signed-off-by: Peter Wienemann <wienemann@physik.uni-bonn.de>
src/ceph-create-keys

index 437b7b207fdd148c3f9f1ab9073235e08204dbd4..176b06e7a380238dbd602b1abe8b6626b1a0d770 100755 (executable)
@@ -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: