]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/_ext: use iterator of tuple to build dict
authorKefu Chai <kchai@redhat.com>
Thu, 14 Jan 2021 12:17:59 +0000 (20:17 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 15 Jan 2021 09:25:27 +0000 (17:25 +0800)
As suggested by Ernesto Puerta <epuertat@redhat.com>

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/_ext/ceph_commands.py

index 4c91cd83f951ced2b1f1f4d563d2e0eaae3ec248..58daba8f1de5e6c896352bfb4e83882948c790aa 100644 (file)
@@ -162,8 +162,8 @@ class Sig:
     @staticmethod
     def _parse_arg_desc(desc):
         try:
-            return {kv.split('=')[0]: kv.split('=')[1] for kv in desc.split(',') if kv}
-        except IndexError:
+            return dict(kv.split('=') for kv in desc.split(',') if kv)
+        except ValueError:
             return desc
 
     @staticmethod