]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_argparse: simplify osd name and target types
authorSage Weil <sage@redhat.com>
Wed, 18 Sep 2019 23:19:41 +0000 (18:19 -0500)
committerSage Weil <sage@redhat.com>
Wed, 18 Sep 2019 23:22:09 +0000 (18:22 -0500)
In both cases there is only ever one of these, so a simple '<id|osd.id>'
or '<type.id>' is sufficient.

Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/ceph_argparse.py

index 6920d75e77c4e72e0e8dcbce5b2026bca6e509ee..bda37e6ab6ee40b6acd45ae1208e400b2e54af0d 100644 (file)
@@ -708,6 +708,14 @@ class argdesc(object):
             chunk = "--{0}".format(self.name.replace("_", "-"))
         elif self.t == CephPrefix or self.t == CephChoices:
             chunk = str(self.instance)
+        elif self.t == CephOsdName:
+            # it just so happens all CephOsdName commands are named 'id' anyway,
+            # so <id|osd.id> is perfect.
+            chunk = '<id|osd.id>'
+        elif self.t == CephName:
+            # CephName commands similarly only have one arg of the
+            # type, so <type.id> is good.
+            chunk = '<type.id>'
         else:
             chunk = '<{0}>'.format(self.name)
         s = chunk