]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind: fix handling bad cmd json
authorJohn Spray <john.spray@redhat.com>
Fri, 17 Jun 2016 14:24:49 +0000 (15:24 +0100)
committerJohn Spray <john.spray@redhat.com>
Thu, 29 Sep 2016 16:26:52 +0000 (17:26 +0100)
The 'save_exception' local would otherwise
be referenced before assignment during
exception handling.

Signed-off-by: John Spray <john.spray@redhat.com>
src/pybind/ceph_argparse.py

index 580566a42d8e82755cd94733ea9dca143f660314..8f4786d53cd2942426bb7acf07b3f6dccba46879 100644 (file)
@@ -904,6 +904,8 @@ def validate(args, signature, partial=False):
     reqsiglen = len([desc for desc in mysig if desc.req])
     matchcnt = 0
     d = dict()
+    save_exception = None
+
     for desc in mysig:
         setattr(desc, 'numseen', 0)
         while desc.numseen < desc.n: