Example #1
0
 def validate_default_prefixlen(self, min_prefixlen, max_prefixlen,
                                default_prefixlen):
     if default_prefixlen < min_prefixlen:
         raise n_exc.IllegalSubnetPoolPrefixBounds(
             prefix_type='default_prefixlen',
             prefixlen=default_prefixlen,
             base_prefix_type='min_prefixlen',
             base_prefixlen=min_prefixlen)
     if default_prefixlen > max_prefixlen:
         raise n_exc.IllegalSubnetPoolPrefixBounds(
             prefix_type='default_prefixlen',
             prefixlen=default_prefixlen,
             base_prefix_type='max_prefixlen',
             base_prefixlen=max_prefixlen)
Example #2
0
 def validate_max_prefixlen(self, prefixlen, ip_version):
     max = self._PREFIX_VERSION_INFO[ip_version]['max_prefixlen']
     if prefixlen > max:
         raise n_exc.IllegalSubnetPoolPrefixBounds(
             prefix_type='max_prefixlen',
             prefixlen=prefixlen,
             base_prefix_type='ip_version_max',
             base_prefixlen=max)
Example #3
0
 def validate_min_prefixlen(self, min_prefixlen, max_prefixlen):
     if min_prefixlen < 0:
         raise n_exc.UnsupportedMinSubnetPoolPrefix(prefix=min_prefixlen,
                                                    version=4)
     if min_prefixlen > max_prefixlen:
         raise n_exc.IllegalSubnetPoolPrefixBounds(
             prefix_type='min_prefixlen',
             prefixlen=min_prefixlen,
             base_prefix_type='max_prefixlen',
             base_prefixlen=max_prefixlen)