]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: always ignore a missing ceph conf in main.py 22831/head
authorAndrew Schoen <aschoen@redhat.com>
Tue, 3 Jul 2018 11:45:24 +0000 (06:45 -0500)
committerAndrew Schoen <aschoen@redhat.com>
Tue, 3 Jul 2018 15:44:10 +0000 (10:44 -0500)
Now that we have a nice error message when a ceph.conf is missing
and we try to use values from it, maintaining a list of commands that
don't need ceph.conf isn't as helpful. We had actually missed 'simple
trigger' when we first implemented this causing all our luminous tests
for simple to fail when we backported.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 0487a9ac60c5ba289b7dd7c730b014a298c5998f)

src/ceph-volume/ceph_volume/main.py

index 561a95b5a6f7015c6ea99ba1ddce0b0ce151420c..b3543b1a21d63e86b4daf40d3a689febf118bb97 100644 (file)
@@ -10,12 +10,6 @@ from ceph_volume.decorators import catches
 from ceph_volume import log, devices, configuration, conf, exceptions, terminal
 
 
-IGNORE_CEPH_CONFIG_COMMANDS = [
-    "lvm list",
-    "lvm zap",
-]
-
-
 class Volume(object):
     _help = """
 ceph-volume: Deploy Ceph OSDs using different device technologies like lvm or
@@ -150,16 +144,11 @@ Ceph Conf: {ceph_path}
         try:
             conf.ceph = configuration.load(conf.path)
         except exceptions.ConfigurationError as error:
-            is_help = "-h" in subcommand_args or "--help" in subcommand_args
-            if " ".join(subcommand_args[:2]) in IGNORE_CEPH_CONFIG_COMMANDS or is_help:
-                # we warn only here, because it is possible that the configuration
-                # file is not needed, or that it will be loaded by some other means
-                # (like reading from lvm tags)
-                logger.exception('ignoring inability to load ceph.conf')
-                terminal.red(error)
-            else:
-                terminal.red(error)
-                raise
+            # we warn only here, because it is possible that the configuration
+            # file is not needed, or that it will be loaded by some other means
+            # (like reading from lvm tags)
+            logger.exception('ignoring inability to load ceph.conf')
+            terminal.red(error)
         # dispatch to sub-commands
         terminal.dispatch(self.mapper, subcommand_args)