]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: accept config files containing whitespaces
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Fri, 8 May 2020 09:08:43 +0000 (09:08 +0000)
committerLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 28 Oct 2020 09:55:13 +0000 (09:55 +0000)
At the moment, the ceph config file location cannot contain
whitespaces. This applies to all platforms but is quite an
inconvenient on Windows in particular, where it's very common
to have default paths containing white spaces.

ceph_resolve_file_search expects a list of config files and uses
"get_str_list" to separate them. No delimiter list is explicitly
specified, so the default delimiter list is used, which includes
white space.

This change will explicitly set the delimiters to "," and ";".

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

index 129cb344dac59121c9d41e41a38e04ec6cd0b842..1f61395283ecfd24b51f5292d0136ed1b6b485d4 100644 (file)
@@ -60,9 +60,9 @@ using ceph::decode;
 using ceph::encode;
 using ceph::Formatter;
 
-static const char *CEPH_CONF_FILE_DEFAULT = "$data_dir/config, /etc/ceph/$cluster.conf, $home/.ceph/$cluster.conf, $cluster.conf"
+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"
+    ",/usr/local/etc/ceph/$cluster.conf"
 #endif
     ;
 
@@ -87,7 +87,7 @@ int ceph_resolve_file_search(const std::string& filename_list,
                             std::string& result)
 {
   list<string> ls;
-  get_str_list(filename_list, ls);
+  get_str_list(filename_list, ";,", ls);
 
   int ret = -ENOENT;
   list<string>::iterator iter;
@@ -440,7 +440,7 @@ md_config_t::get_conffile_paths(const ConfigValues& values,
   }
 
   std::list<std::string> paths;
-  get_str_list(conf_files_str, paths);
+  get_str_list(conf_files_str, ";,", paths);
   for (auto i = paths.begin(); i != paths.end(); ) {
     string& path = *i;
     if (path.find("$data_dir") != path.npos &&