]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
win32,common: provide a default ceph.conf location
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Tue, 10 Mar 2020 17:07:52 +0000 (17:07 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 28 Oct 2020 09:56:04 +0000 (09:56 +0000)
We're going to use %ProgramData%\ceph\ceph.conf as the default
ceph.conf location on Windows.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
src/common/config.cc

index c2bfd754674d8416c16623bcd039f1a57cef13e7..f97224954051133c7c583f6ead10f4ce6bda356e 100644 (file)
@@ -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;
        }