#NEWLINE# def _validate_multicast_ip_range( self , network_profile ) : #NEWLINE# #INDENT# '\n        Validate multicast ip range values.\n\n        :param network_profile: network profile object\n        ' #NEWLINE# try : #NEWLINE# #INDENT# ( min_ip , max_ip ) = network_profile [ 'multicast_ip_range' ] . split ( '-' , 1 ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# msg = _LE ( 'Invalid multicast ip address range. example range: 224.1.1.1-224.1.1.10' ) #NEWLINE# LOG . error ( msg ) #NEWLINE# raise n_exc . InvalidInput ( error_message = msg ) #NEWLINE# #UNINDENT# for ip in [ min_ip , max_ip ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# if ( not netaddr . IPAddress ( ip ) . is_multicast ( ) ) : #NEWLINE# #INDENT# msg = ( _LE ( '%s is not a valid multicast ip address' ) % ip ) #NEWLINE# LOG . error ( msg ) #NEWLINE# raise n_exc . InvalidInput ( error_message = msg ) #NEWLINE# #UNINDENT# if ( netaddr . IPAddress ( ip ) <= netaddr . IPAddress ( '224.0.0.255' ) ) : #NEWLINE# #INDENT# msg = ( _LE ( '%s is reserved multicast ip address' ) % ip ) #NEWLINE# LOG . error ( msg ) #NEWLINE# raise n_exc . InvalidInput ( error_message = msg ) #NEWLINE# #UNINDENT# #UNINDENT# except netaddr . AddrFormatError : #NEWLINE# #INDENT# msg = ( _LE ( '%s is not a valid ip address' ) % ip ) #NEWLINE# LOG . error ( msg ) #NEWLINE# raise n_exc . InvalidInput ( error_message = msg ) #NEWLINE# #UNINDENT# #UNINDENT# if ( netaddr . IPAddress ( min_ip ) > netaddr . IPAddress ( max_ip ) ) : #NEWLINE# #INDENT# msg = ( _LE ( "Invalid multicast IP range '%(min_ip)s-%(max_ip)s': Range should be from low address to high address" ) % { #NEWLINE# #INDENT# 'min_ip' : min_ip , #NEWLINE# 'max_ip' : max_ip , #NEWLINE# #UNINDENT# } ) #NEWLINE# LOG . error ( msg ) #NEWLINE# raise n_exc . InvalidInput ( error_message = msg )