New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
common: Better handling for missing/inaccessible ceph.conf files #14757
Changes from 5 commits
058ac85
623e1a8
71728a4
cd96ee5
96f9519
9a5954f
0825f4e
1fc50db
4bdc18a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we use "warnings.tellp() > 0" to avoid the string copy here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose. I did a quick scan and missed that. Is it idiomatic? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
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; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might want to use
__func__
here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could. would save a little data space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done