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>
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