]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
global, common: Print config parse errors
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 8 May 2020 12:25:55 +0000 (12:25 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 28 Oct 2020 09:55:20 +0000 (09:55 +0000)
At the moment, config parsing errors aren't printed by "global_init",
so the message shown to the user can be a bit cryptic.

This change will ensure that those parsing errors will be printed.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/common/config_proxy.h
src/global/global_init.cc

index 5632fe4efadcf86ac85761160f332ce73e7e236a..e8528c0f67c82b34a8c54b4cb190dd3aca938a1f 100644 (file)
@@ -324,6 +324,9 @@ public:
   bool has_parse_error() const {
     return !config.parse_error.empty();
   }
+  std::string get_parse_error() {
+    return config.parse_error;
+  }
   void complain_about_parse_error(CephContext *cct) {
     return config.complain_about_parse_error(cct);
   }
index 84acd4850dd6fb1af32450dce347b2d1cdc3ef4e..127cee17a447f48833ca91a54ddaa85d7eb38847 100644 (file)
@@ -159,7 +159,8 @@ void global_pre_init(
   }
   else if (ret) {
     cct->_log->flush();
-    cerr << "global_init: error reading config file." << std::endl;
+    cerr << "global_init: error reading config file. "
+         << conf.get_parse_error() << std::endl;
     _exit(1);
   }