]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/argparse: handle None sequence
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 25 May 2021 21:54:11 +0000 (14:54 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 24 Nov 2021 20:54:30 +0000 (12:54 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/pybind/ceph_argparse.py

index d24b8f8daa49a8d9eb99f6dd35be07b466c2ef2d..b4aace3dfb80a6ea7e09e9aad7cd5b18ad7aac05 100644 (file)
@@ -218,6 +218,8 @@ class CephArgtype(object):
         orig_type = get_origin(tp)
         type_args = get_args(tp)
         if orig_type in (abc.Sequence, Sequence, List, list):
+            if v is None:
+                return None
             return [CephArgtype.cast_to(type_args[0], e) for e in v]
         elif orig_type is Tuple:
             return tuple(CephArgtype.cast_to(type_args[0], e) for e in v)