]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: Validate bootstrap "--dashboard-{key|crt}" path
authorRicardo Marques <rimarques@suse.com>
Mon, 25 May 2020 10:53:59 +0000 (11:53 +0100)
committerRicardo Marques <rimarques@suse.com>
Mon, 25 May 2020 10:53:59 +0000 (11:53 +0100)
Fixes: https://tracker.ceph.com/issues/45696
Signed-off-by: Ricardo Marques <rimarques@suse.com>
src/cephadm/cephadm

index 43da104b136bf6d818eac16465afc4138b8f5616..8878587d7f217c052844278bfd4385a9ad20ccc4 100755 (executable)
@@ -2612,9 +2612,10 @@ def command_bootstrap():
         # dashboard crt and key
         if args.dashboard_key and args.dashboard_crt:
             logger.info('Using provided dashboard certificate...')
-            mounts = {}
-            mounts[pathify(args.dashboard_crt)] = '/tmp/dashboard.crt:z'
-            mounts[pathify(args.dashboard_key)] = '/tmp/dashboard.key:z'
+            mounts = {
+                pathify(args.dashboard_crt.name): '/tmp/dashboard.crt:z',
+                pathify(args.dashboard_key.name): '/tmp/dashboard.key:z'
+            }
             cli(['dashboard', 'set-ssl-certificate', '-i', '/tmp/dashboard.crt'], extra_mounts=mounts)
             cli(['dashboard', 'set-ssl-certificate-key', '-i', '/tmp/dashboard.key'], extra_mounts=mounts)
         else:
@@ -4459,9 +4460,11 @@ def _get_parser():
 
     parser_bootstrap.add_argument(
         '--dashboard-key',
+        type=argparse.FileType('r'),
         help='Dashboard key')
     parser_bootstrap.add_argument(
         '--dashboard-crt',
+        type=argparse.FileType('r'),
         help='Dashboard certificate')
 
     parser_bootstrap.add_argument(