]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
cli: do not parse injectargs arguments twice
authorLoic Dachary <loic-201408@dachary.org>
Thu, 16 Oct 2014 06:04:03 +0000 (23:04 -0700)
committerLoic Dachary <loic-201408@dachary.org>
Tue, 21 Oct 2014 06:03:07 +0000 (23:03 -0700)
commita458bd83f5cb159b1a3bf5b7020cda9ad9290f29
tree667c1f86bc9b1b9390f1d51ab3c6df26c4cdc299
parentf1afb182590238241f34b1d8cb378732168951b9
cli: do not parse injectargs arguments twice

The arguments of injectargs being valid ceph arguments, they are.
consumed when the ceph cli calls rados.conf_parse_argv(). It can be
worked around by obsuring them as in:

   ceph tell osd.0 injectargs '--osd_debug_drop_ping_probability 444'

where '--osd_debug_drop_ping_probability 444' is a single argument that
does not match any known argument. The trick is that it will be
evaluated again once it reaches the OSD or the MON and translated into
the expected list of arguments. Although it is clear once explained, it
is obscure and leads to strange combinations such as:

   ceph tell osd.0 injectargs '--osd_debug_op_order '

(note the extra space at the end) to set boolean parameters. A better
workaround is to add a -- marking the end of the options as in:

   ceph tell osd.0 -- injectargs --osd_debug_op_order

this one is unfortunately much less documented and the user does not
usually know the exact semantic of --, let alone where it should be
placed.

The simpler solution is to split the argument list in two if
"injectargs" is found. The arguments that show after the "injectargs"
argument is removed from the list of arguments until parsing is
complete. It implements the more intuitive syntax:

   ceph tell osd.0 injectargs --osd_debug_op_order

and the other forms are still valid for backward compatibility.

http://tracker.ceph.com/issues/9372 Fixes: #9372

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
qa/workunits/cephtool/test.sh
src/ceph.in