From: Lucian Petrut Date: Fri, 8 May 2020 12:25:55 +0000 (+0000) Subject: global, common: Print config parse errors X-Git-Tag: v16.1.0~652^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a31be84abee17a7597bf5add047c3c0ad3aef831;p=ceph.git global, common: Print config parse errors 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 --- diff --git a/src/common/config_proxy.h b/src/common/config_proxy.h index 5632fe4efad..e8528c0f67c 100644 --- a/src/common/config_proxy.h +++ b/src/common/config_proxy.h @@ -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); } diff --git a/src/global/global_init.cc b/src/global/global_init.cc index 84acd4850dd..127cee17a44 100644 --- a/src/global/global_init.cc +++ b/src/global/global_init.cc @@ -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); }