From: Sage Weil Date: Tue, 6 Jun 2017 13:23:32 +0000 (-0400) Subject: pybind/ceph_argparse: fix no arg check X-Git-Tag: v12.1.0~261^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f37ab313feb2864e06691d0880ecae345de9b74e;p=ceph.git pybind/ceph_argparse: fix no arg check This fixes breakage from commit a1214a702cfd8465deb91847f4dc63c0e80fb586 that caused a [] to be appended to some json argument lists. Fixes: http://tracker.ceph.com/issues/20135 Signed-off-by: Sage Weil --- diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 54fbdeb49f2e..cc96d7708dc9 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -924,12 +924,12 @@ def validate(args, signature, flags=0, partial=False): # no arg, but not required? Continue consuming mysig # in case there are later required args - if myarg == None and not desc.req: + if myarg in (None, []) and not desc.req: break # out of arguments for a required param? # Either return (if partial validation) or raise - if myarg == None and desc.req: + if myarg in (None, []) and desc.req: if desc.N and desc.numseen < 1: # wanted N, didn't even get 1 if partial: