]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_argparse: ensure osd id is >= 0
authorKefu Chai <kchai@redhat.com>
Mon, 19 Oct 2015 16:48:13 +0000 (12:48 -0400)
committerKefu Chai <kchai@redhat.com>
Tue, 3 May 2016 14:42:30 +0000 (22:42 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/ceph_argparse.py

index 96af31f40255e07f9f06215558ac5d899b8060a8..ed659a17dac981a1ea75c0ba075d4bde443da1d3 100644 (file)
@@ -423,6 +423,8 @@ class CephOsdName(CephArgtype):
             i = int(i)
         except:
             raise ArgumentFormat('osd id ' + i + ' not integer')
+        if i < 0:
+            raise ArgumentFormat('osd id {0} is less than 0'.format(i))
         self.nametype = t
         self.nameid = i
         self.val = i