MDSMonitor, cmdparse: increase resiliency of bad cmd_getval()

MDSMonitor: check for and handle bad maxmds get
cmdparse.h: Use gcc demangler to print bad boost::variant typenames,
add backtrace in case of bad boost::variant get

Signed-off-by: Dan Mick <dan.mick@inktank.com>
cephtool/test.sh: fix "expect failure"

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph: finish changing bestsigs to bestcmds

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph: move admin-daemon command before connect()

Allow admin-daemon commands to work even if we can't connect()

Signed-off-by: Dan Mick <dan.mick@inktank.com>
mon/MonCap: allow osd, mds to write to cluster log

Signed-off-by: Sage Weil <sage@inktank.com>
mon: include cluster fsid/uuid in status output

Implements: #5147
Signed-off-by: Sage Weil <sage@inktank.com>
ceph: make ceph -w output 'ceph status' first

Signed-off-by: Dan Mick <dan.mick@inktank.com>
librados, rados.py: add conf_parse_argv_remainder()

New parsing function to extract any known arguments from a vector
and return any unknowns; useful for ceph CLI to allow librados
first dibs on arguments so it doesn't have to reproduce the
argument recognition

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph: use conf_parse_argv to deal with nonspecial Ceph args

This means parsing argv only once now, so pass arg lists to
new_style_command().  A little cleanup/commenting too.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph: remove global declarations, declare verbose and cluster near top

Signed-off-by: Dan Mick <dan.mick@inktank.com>
cmdparse: add handle_bad_get(), ceph:: qualifiers, cmdmap_t

Signed-off-by: Dan Mick <dan.mick@inktank.com>
cmdparse, mon: add cmd_vartype_stringify for _allowed_command

cmd_vartype are not all strings, and need a type-variant function
to turn them into strings for authorization against caps.  Use
boost::apply_visitor to get this behavior.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
PGMonitor: fix pg dump and dump_stuck

dump needed to default to format plain, not json
dump_stuck was not doing format = plain correctly (coredumping)

Signed-off-by: Dan Mick <dan.mick@inktank.com>
ceph: various cleanups
 - make base class valid() do useful work
 - remove valid from CephPoolname; pool need not exist for create
 - add --user as alias for --id
 - remove vestige of special --keyring handing
 - be sure childargs is an empty list rather than None
 - remove -- from childargs if present (to stop interpreting -- args)
 - handle connection timeout cleanly

Signed-off-by: Dan Mick <dan.mick@inktank.com>
mon/MonCap: set text in set_allow_all()

This will let the cap encode/decode to the same value.

Signed-off-by: Sage Weil <sage@inktank.com>
mon/MonCap: fix setting of text in parse()

Signed-off-by: Sage Weil <sage@inktank.com>
mon: better debugging of caps messages/values

Signed-off-by: Sage Weil <sage@inktank.com>
ceph: refactor help so it can be called after cluster connection

Signed-off-by: Dan Mick <dan.mick@inktank.com>
librados: fix unsigned vs. signed warning

Signed-off-by: Dan Mick <dan.mick@inktank.com>
librados cmd tests: mon_status comes to stdout, not stderr

Signed-off-by: Dan Mick <dan.mick@inktank.com>