#NEWLINE# def _parse_host_attributes( self , attribute_str ) : #NEWLINE# #INDENT# attribute_list = attribute_str . split ( '/' ) #NEWLINE# attribute_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# attribute_dict [ 'ip' ] = attribute_list [ 0 ] #NEWLINE# for attribute_item in attribute_list [ 1 : ] : #NEWLINE# #INDENT# if ( attribute_item . find ( '=' ) == ( - 1 ) ) : #NEWLINE# #INDENT# Log . print_critical ( 'The host attributes definition are wrong. Please check your configuration file.' ) #NEWLINE# #UNINDENT# ( attribute_name , attribute_val ) = attribute_item . split ( '=' ) #NEWLINE# attribute_dict [ attribute_name ] = self #NEWLINE# #UNINDENT# instance_num = int ( attribute_dict . get ( 'instance_num' , 1 ) ) #NEWLINE# if ( instance_num < 1 ) : #NEWLINE# #INDENT# Log . print_critical ( 'The instance number must be greater than or equal to 1!' ) #NEWLINE# #UNINDENT# attribute_dict [ 'instance_num' ] = instance_num #NEWLINE# for ( attribute_name , attribute_val ) in attribute_dict . iteritems ( ) : #NEWLINE# #INDENT# setattr ( self , attribute_name , attribute_val )