values.cluster = get_cluster_name(nullptr);
}
// open new conf
- string conffile;
for (auto& fn : get_conffile_paths(values, conf_files_str, warnings, flags)) {
bufferlist bl;
std::string error;
int ret = parse_buffer(values, tracker, bl.c_str(), bl.length(), &oss);
if (ret == 0) {
parse_error.clear();
- conffile = fn;
+ conf_path = fn;
break;
}
parse_error = oss.str();
}
}
// it must have been all ENOENTs, that's the only way we got here
- if (conffile.empty()) {
+ if (conf_path.empty()) {
return -ENOENT;
}
if (values.cluster.empty()) {
- values.cluster = get_cluster_name(conffile.c_str());
+ values.cluster = get_cluster_name(conf_path.c_str());
}
update_legacy_vals(values);
return 0;
const char *conf_files,
std::ostream *warnings,
int flags) const;
+
+ const std::string& get_conf_path() const {
+ return conf_path;
+ }
private:
static std::string get_cluster_name(const char* conffile_path);
// The configuration file we read, or NULL if we haven't read one.
ConfFile cf;
+ std::string conf_path;
public:
std::string parse_error;
private:
std::lock_guard l{lock};
config.get_defaults_bl(values, bl);
}
+ const std::string& get_conf_path() const {
+ return config.get_conf_path();
+ }
};
}