diff options
author | Sage Weil <sage@inktank.com> | 2013-07-26 22:08:26 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-07-26 22:08:26 -0700 |
commit | 535d8701b95e55926cc87422587d30b271944596 (patch) | |
tree | a43cc8c674862a6fd7e4826d2c9dcce6409ff61d | |
parent | b4bde3cbc044b615a60b6a5f3ffc03cda7e696f0 (diff) | |
download | ceph-535d8701b95e55926cc87422587d30b271944596.tar.gz |
common/admin_socket: do not populate empty help strings
Hidden commands have no help string. Make this consistent: the m_help
entry is always there, but may be empty.
Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r-- | src/common/admin_socket.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/admin_socket.cc b/src/common/admin_socket.cc index 4afd685b72a..e73f3ce0a0c 100644 --- a/src/common/admin_socket.cc +++ b/src/common/admin_socket.cc @@ -390,8 +390,7 @@ int AdminSocket::register_command(std::string command, std::string cmddesc, Admi ldout(m_cct, 5) << "register_command " << command << " hook " << hook << dendl; m_hooks[command] = hook; m_descs[command] = cmddesc; - if (help.length()) - m_help[command] = help; + m_help[command] = help; ret = 0; } m_lock.Unlock(); @@ -448,7 +447,8 @@ public: for (map<string,string>::iterator p = m_as->m_help.begin(); p != m_as->m_help.end(); ++p) { - f->dump_string(p->first.c_str(), p->second); + if (p->second.length()) + f->dump_string(p->first.c_str(), p->second); } f->close_section(); ostringstream ss; |