From: Loic Dachary Date: Sun, 15 Sep 2013 14:40:25 +0000 (+0200) Subject: pybind: catch EntityAddress missing / X-Git-Tag: v0.71~89^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f9c7bc697ce99479ecbcb47571e416ceb53d6bf3;p=ceph.git pybind: catch EntityAddress missing / If the / is missing in an EntityAddress, an ArgumentValid exception must be raised so that it can be caught in the same way other argument validation exceptions are. http://tracker.ceph.com/issues/6274 refs #6274 Reviewed-by: Joao Eduardo Luis Signed-off-by: Loic Dachary --- diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 427a4621216a..f115d3791af8 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -278,7 +278,10 @@ class CephEntityAddr(CephIPAddr): EntityAddress, that is, IP address/nonce """ def valid(self, s, partial=False): - ip, nonce = s.split('/') + try: + ip, nonce = s.split('/') + except: + raise ArgumentValid('{0} must contain a /'.format(s)) super(self.__class__, self).valid(ip) self.nonce = nonce self.val = s