From: Sage Weil Date: Thu, 15 Aug 2013 20:42:50 +0000 (-0700) Subject: config: fix stringification of config values X-Git-Tag: v0.68~66^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fefe0c602f78e66d35fd5806da4c2e4e154a267c;p=ceph.git config: fix stringification of config values 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 Reviewed-by: Samuel Just --- diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 9602fdf2e40d..fcc3798c47a3 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -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(argss, " ")); + argss << *val.begin(); + for (std::vector::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);