From c53d574ac2f1b68c486a68fb6bd09f6f7f8bc0c3 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Thu, 11 Jul 2013 23:06:26 +0200 Subject: [PATCH] can't use RESERVED address in IPOption and NetworkOption --- tiramisu/option.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tiramisu/option.py b/tiramisu/option.py index 5c8bbda..8a1804c 100644 --- a/tiramisu/option.py +++ b/tiramisu/option.py @@ -492,6 +492,8 @@ class IPOption(Option): def _validate(self, value): try: ip = IP('{0}/32'.format(value)) + if ip.iptype() == 'RESERVED': + return False if self._only_private: return ip.iptype() == 'PRIVATE' return True @@ -576,7 +578,9 @@ class NetworkOption(Option): def _validate(self, value): try: - IP(value) + ip = IP(value) + if ip.iptype() == 'RESERVED': + return False return True except ValueError: return False