]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: raise an error when `--config` file is not found
authorMichael Fritch <mfritch@suse.com>
Thu, 13 May 2021 23:03:10 +0000 (17:03 -0600)
committerMichael Fritch <mfritch@suse.com>
Fri, 14 May 2021 22:24:38 +0000 (16:24 -0600)
extend the common logic used by the deploy, ceph-volume, and shell
commands for validating the `--config` arg during bootstrap

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index 92d2399f88259dc54fc198e0df244ac5da360c16..df1b04f64537990f608fdfc1f715c62cdf10509c 100755 (executable)
@@ -3966,11 +3966,7 @@ def command_bootstrap(ctx):
             except PermissionError:
                 raise Error(f'Unable to create {dirname} due to permissions failure. Retry with root, or sudo or preallocate the directory.')
 
-    if ctx.config and os.path.exists(ctx.config):
-        with open(ctx.config) as f:
-            user_conf = f.read()
-    else:
-        user_conf = None
+    (user_conf, _) = get_config_and_keyring(ctx)
 
     if not ctx.skip_prepare_host:
         command_prepare_host(ctx)
@@ -4072,7 +4068,7 @@ def command_bootstrap(ctx):
         # the mgr (e.g. mgr/cephadm/container_image_prometheus)
         # they don't seem to be stored if there isn't a mgr yet.
         # Since re-assimilating the same conf settings should be
-        # idempotent we can just do it aain here.
+        # idempotent we can just do it again here.
         with tempfile.NamedTemporaryFile(buffering=0) as tmp:
             tmp.write(user_conf.encode('utf-8'))
             cli(['config', 'assimilate-conf',