]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
config: fix stringification of config values
authorSage Weil <sage@inktank.com>
Thu, 15 Aug 2013 20:42:50 +0000 (13:42 -0700)
committerSage Weil <sage@inktank.com>
Thu, 15 Aug 2013 20:42:50 +0000 (13:42 -0700)
The std::copy construct leaves a trailing separator character, which breaks
parsing for booleans (among other things) and probably mangles everything
else too.

Backport: dumpling
Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Samuel Just <sam.just@inktank.com>
src/common/ceph_context.cc

index 9602fdf2e40d8b92ebd1f1b3c93694e5796156a7..fcc3798c47a32d10eb63048253a5553ba99b0f8f 100644 (file)
@@ -198,7 +198,10 @@ void CephContext::do_command(std::string command, cmdmap_t& cmdmap,
       } else {
        // val may be multiple words
        ostringstream argss;
-       std::copy(val.begin(), val.end(), ostream_iterator<string>(argss, " "));
+       argss << *val.begin();
+       for (std::vector<std::string>::iterator i = val.begin() + 1; i != val.end(); ++i) {
+         argss << "," << *i;
+       }
         int r = _conf->set_val(var.c_str(), argss.str().c_str());
         if (r < 0) {
           f->dump_stream("error") << "error setting '" << var << "' to '" << val << "': " << cpp_strerror(r);