From b8ddd04364f31bd3cbcd32c169870ee177a2f4f3 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Tue, 10 Mar 2020 17:07:52 +0000 Subject: [PATCH] win32,common: provide a default ceph.conf location We're going to use %ProgramData%\ceph\ceph.conf as the default ceph.conf location on Windows. Signed-off-by: Lucian Petrut --- src/common/config.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/config.cc b/src/common/config.cc index c2bfd754674d..f97224954051 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -63,6 +63,8 @@ using ceph::Formatter; static const char *CEPH_CONF_FILE_DEFAULT = "$data_dir/config,/etc/ceph/$cluster.conf,$home/.ceph/$cluster.conf,$cluster.conf" #if defined(__FreeBSD__) ",/usr/local/etc/ceph/$cluster.conf" +#elif defined(_WIN32) + ",$programdata/ceph/$cluster.conf" #endif ; @@ -1226,7 +1228,10 @@ Option::value_t md_config_t::_expand_meta( } else if (var == "home") { const char *home = getenv("HOME"); out = home ? std::string(home) : std::string(); - } else { + } else if (var == "programdata") { + const char *home = getenv("ProgramData"); + out = home ? std::string(home) : std::string(); + }else { if (var == "data_dir") { var = data_dir_option; } -- 2.47.3