From: Lucian Petrut Date: Tue, 10 Mar 2020 17:07:52 +0000 (+0000) Subject: win32,common: provide a default ceph.conf location X-Git-Tag: v16.1.0~652^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b8ddd04364f31bd3cbcd32c169870ee177a2f4f3;p=ceph.git 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 --- diff --git a/src/common/config.cc b/src/common/config.cc index c2bfd754674..f9722495405 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; }