Merge pull request #3031 from dachary/wip-10199-config-get-xml

common: admin sock output XML elements whitespace

Reviewed-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>
This commit is contained in:
Loic Dachary 2014-12-05 00:07:59 +01:00
commit 744c309e1d
2 changed files with 6 additions and 2 deletions

View File

@ -14,6 +14,8 @@
#include <time.h>
#include <boost/algorithm/string.hpp>
#include "common/admin_socket.h"
#include "common/perf_counters.h"
#include "common/Thread.h"
@ -200,7 +202,9 @@ void CephContext::do_command(std::string command, cmdmap_t& cmdmap,
}
}
else {
f->open_object_section(command.c_str());
string section = command;
boost::replace_all(section, " ", "_");
f->open_object_section(section.c_str());
if (command == "config show") {
_conf->show_config(f);
}

View File

@ -39,7 +39,7 @@ TEST(CephContext, do_command)
bufferlist out;
cct->do_command("config get", cmdmap, "xml", &out);
string s(out.c_str(), out.length());
EXPECT_EQ("<config get><key>" + value + "</key></config get>", s);
EXPECT_EQ("<config_get><key>" + value + "</key></config_get>", s);
}
{