From 5ad9d6a0ff29ba367f9fffc54e9c7745d5ee9837 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 19 Oct 2015 12:48:13 -0400 Subject: [PATCH] pybind/ceph_argparse: ensure osd id is >= 0 Signed-off-by: Kefu Chai --- src/pybind/ceph_argparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 96af31f40255e..ed659a17dac98 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -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 -- 2.39.5