]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #3031 from dachary/wip-10199-config-get-xml
authorLoic Dachary <dachary@users.noreply.github.com>
Thu, 4 Dec 2014 23:07:59 +0000 (00:07 +0100)
committerLoic Dachary <dachary@users.noreply.github.com>
Thu, 4 Dec 2014 23:07:59 +0000 (00:07 +0100)
common: admin sock output XML elements whitespace

Reviewed-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@redhat.com>
1  2 
src/common/ceph_context.cc

index 66c38bdd7319fb8af43e83a84ff9452f08aa7bef,a8633b1520d000df167e740a2c5445c8fb0617ad..cac89f1e3e3e92fb8ec31d552f96eb2401a8f2fa
@@@ -190,17 -192,10 +192,19 @@@ void CephContext::do_command(std::strin
      command == "perf schema") {
      _perf_counters_collection->dump_formatted(f, true);
    }
 +  else if (command == "perf reset") {
 +    std::string var;
 +    if (!cmd_getval(this, cmdmap, "var", var)) {
 +      f->dump_string("error", "syntax error: 'perf reset <var>'");
 +    } else {
 +     if(!_perf_counters_collection->reset(var))
 +        f->dump_stream("error") << "Not find: " << var;
 +    }
 +  }
    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);
      }