From 96f95193f654385b5e8760d26be37d8c35eebf4f Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Mon, 24 Apr 2017 15:37:49 -0700 Subject: [PATCH] librados/librados.cc rados_conf_read_file: report errors to client Previously all the error text was hidden; log it. Note: ENOENT is noted as a 'parse error' Signed-off-by: Dan Mick --- src/librados/librados.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librados/librados.cc b/src/librados/librados.cc index fa6d61eb6d16c..44a632f02953f 100644 --- a/src/librados/librados.cc +++ b/src/librados/librados.cc @@ -2820,8 +2820,12 @@ extern "C" int rados_conf_read_file(rados_t cluster, const char *path_list) tracepoint(librados, rados_conf_read_file_enter, cluster, path_list); librados::RadosClient *client = (librados::RadosClient *)cluster; md_config_t *conf = client->cct->_conf; - int ret = conf->parse_config_files(path_list, NULL, 0); + ostringstream warnings; + int ret = conf->parse_config_files(path_list, &warnings, 0); if (ret) { + if (warnings.str().length()) + lderr(client->cct) << warnings.str() << dendl; + client->cct->_conf->complain_about_parse_errors(client->cct); tracepoint(librados, rados_conf_read_file_exit, ret); return ret; } -- 2.39.5