diff options
author | Loic Dachary <loic@dachary.org> | 2013-09-15 16:40:25 +0200 |
---|---|---|
committer | Gary Lowell <gary.lowell@inktank.com> | 2013-10-09 10:04:51 -0700 |
commit | 49d9e1522eb06261f799ec484eefa6f05f4b8337 (patch) | |
tree | e5608a91290da10a2569b3561b7b0c36dc50711f | |
parent | 20312b785a12c20fb90b9acf0bf9531b3c5120fb (diff) | |
download | ceph-49d9e1522eb06261f799ec484eefa6f05f4b8337.tar.gz |
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 <joao.luis@inktank.com>
Signed-off-by: Loic Dachary <loic@dachary.org>
-rw-r--r-- | src/pybind/ceph-argparse/ceph_argparse.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pybind/ceph-argparse/ceph_argparse.py b/src/pybind/ceph-argparse/ceph_argparse.py index 427a4621216..f115d3791af 100644 --- a/src/pybind/ceph-argparse/ceph_argparse.py +++ b/src/pybind/ceph-argparse/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 |