]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_argparse.py: add stderr note if nonrequired param is invalid
authorDan Mick <dan.mick@inktank.com>
Sat, 3 Aug 2013 03:46:00 +0000 (20:46 -0700)
committerDan Mick <dan.mick@inktank.com>
Mon, 5 Aug 2013 18:20:36 +0000 (11:20 -0700)
If we run across a user-supplied parameter that doesn't validate against
a non-required descriptor, it may be that it's a valid entry for a later
descriptor...or it may be that it's supposed to match.  We can't really tell.
A possible heuristic would be to call it invalid-for-sure if we're at the
end of the descriptor list, but that's not very generic.

Warn about it and try to drive on anyway.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
src/pybind/ceph_argparse.py

index 0537f3249684cf95788426c3015470e21fadfa2d..2a6fe6e4d02378d7469228cf360ed7e07592558c 100644 (file)
@@ -845,6 +845,7 @@ def validate(args, signature, partial=False):
                 if not desc.req:
                     # if not required, just push back; it might match
                     # the next arg
+                    print >> sys.stderr, myarg, 'not valid: ', str(e)
                     myargs.insert(0, myarg)
                     break
                 else: