#NEWLINE# @ staticmethod #NEWLINE# def validate_ip_pool( ip_pool , ip_version ) : #NEWLINE# #INDENT# attr . _validate_subnet ( ip_net ) #NEWLINE# ip_net = netaddr . IPNetwork ( ip_pool ) #NEWLINE# if ( ip_net . version != ip_version ) : #NEWLINE# #INDENT# raise gpolicy . InvalidIpPoolVersion ( ip_pool = ip_pool , version = ip_version ) #NEWLINE# #UNINDENT# if ( ip_net . size <= 3 ) : #NEWLINE# #INDENT# err_msg = 'Too few available IPs in the pool.' #NEWLINE# raise gpolicy . InvalidIpPoolSize ( ip_pool = ip_pool , err_msg = err_msg , size = ip_net . size ) #NEWLINE# #UNINDENT# if ( ip_net . prefixlen == 0 ) : #NEWLINE# #INDENT# err_msg = 'Prefix length of 0 is invalid.' #NEWLINE# raise gpolicy . InvalidIpPoolPrefixLength ( ip_pool = ip_pool , err_msg = err_msg , prefixlen = ip_net . prefixlen )