In rados_conf_read_file, read from the default configuration file
locations if the library user passes NULL as the location of the
configuration file.
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
// The defaults for CephInitParameters
CephInitParameters::CephInitParameters(uint32_t module_type)
- : conf_file("/etc/ceph/ceph.conf, ~/.ceph/config, ceph.conf")
+ : conf_file(CEPH_CONF_FILE_DEFAULT)
{
const char *conf_file_ = getenv("CEPH_CONF");
if (conf_file_)
#undef generic_dout
#undef dendl
+const char *CEPH_CONF_FILE_DEFAULT = "/etc/ceph/ceph.conf, ~/.ceph/config, ceph.conf";
+
/* The Ceph configuration. */
md_config_t g_conf __attribute__((init_priority(103)));
struct ConfFile;
+extern const char *CEPH_CONF_FILE_DEFAULT;
+
struct md_config_t
{
md_config_t();
using namespace std;
#include "common/config.h"
+#include "include/str_list.h"
#include "mon/MonMap.h"
#include "mds/MDS.h"
// -- config --
extern "C" int rados_conf_read_file(rados_t cluster, const char *path)
{
+ if (!path)
+ path = CEPH_CONF_FILE_DEFAULT;
+
std::list<std::string> conf_files;
- conf_files.push_back(path);
+ get_str_list(path, conf_files);
int ret = g_conf.parse_config_files(conf_files);
if (ret)
return ret;