mirror of
https://github.com/ceph/ceph
synced 2025-01-29 22:43:40 +00:00
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:
commit
744c309e1d
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user