]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph_argparse: increment matchcnt on kwargs 33004/head
authorMatthew Oliver <moliver@suse.com>
Tue, 4 Feb 2020 02:29:48 +0000 (13:29 +1100)
committerMatthew Oliver <moliver@suse.com>
Tue, 4 Feb 2020 02:29:48 +0000 (13:29 +1100)
commitcb37c9ee609864a078edf38d98608bd8cc18cbd7
treedec9df6213970933c07c22b8384088e6f363c3ad
parent79040c2ea3c2a4e600d50f2fa587d996cf5ba868
ceph_argparse: increment matchcnt on kwargs

Currently when you pass a param in on the ceph cli as a kwarg
(--<param_name>) the matchcnt isn't incremented in the validate method
which is used to choose the right command signature.

This means currently things fail like:

  ceph orchestrator rgw rm --realm_name=default --zone_name=default
  no valid command found; 1 closest matches:
  orchestrator rgw rm <realm_name> <zone_name>
  Error EINVAL: invalid command

The '--realm_name' and '--zone_name' isn't counted to the matchcnt, so
'orchestrator rgw rm' isn't picked as the valid command.

This patch simply corrects this by incrementing matchcnt on the kwarg
validate path before calling shortcircuiting the loop.

Fixes: https://tracker.ceph.com/issues/43803
Signed-off-by: Matthew Oliver <moliver@suse.com>
src/pybind/ceph_argparse.py
src/test/pybind/test_ceph_argparse.py