#NEWLINE# def __init__( self , cfg ) : #NEWLINE# #INDENT# super ( DfaServer , self ) . __init__ ( cfg ) #NEWLINE# self . _cfg = cfg #NEWLINE# self . _host = platform . node ( ) #NEWLINE# self . server = None #NEWLINE# self . events = { #NEWLINE# #INDENT# 'identity.project.created' : self . project_create_event , #NEWLINE# 'identity.project.deleted' : self . project_delete_event , #NEWLINE# 'identity.project.updated' : self . project_update_event , #NEWLINE# 'subnet.create.end' : self . subnet_create_event , #NEWLINE# 'network.create.end' : self . network_create_event , #NEWLINE# 'network.delete.end' : self . network_delete_event , #NEWLINE# 'port.create.end' : self . port_create_event , #NEWLINE# 'port.update.end' : self . port_update_event , #NEWLINE# 'port.delete.end' : self . port_delete_event , #NEWLINE# 'dcnm.network.create' : self . dcnm_network_create_event , #NEWLINE# 'dcnm.network.delete' : self . dcnm_network_delete_event , #NEWLINE# 'server.failure.recovery' : self . failure_recovery , #NEWLINE# 'agent.request.vms' : self . request_vms_info , #NEWLINE# 'agent.request.uplink' : self . request_uplink_info , #NEWLINE# 'cli.static_ip.set' : seg_id_min . set_static_ip_address , #NEWLINE# 'agent.vm_result.update' : self . vm_result_update , #NEWLINE# #UNINDENT# } #NEWLINE# self . project_info_cache = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . network = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . subnet = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . port = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . dfa_threads = [ ] #NEWLINE# self . agents_status_table = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . dcnm_event = None #NEWLINE# seg_id_min = int ( cfg . dcnm . segmentation_id_min ) #NEWLINE# seg_id_max = int ( cfg . dcnm . segmentation_id_max ) #NEWLINE# self . segmentation_pool = set ( six . moves . range ( seg_id_min , ( seg_id_max + 1 ) ) ) #NEWLINE# self . _excpq = queue . Queue ( ) #NEWLINE# self . _load_project_info_cache ( ) #NEWLINE# self . _load_network_info ( ) #NEWLINE# self . pqueue = queue . PriorityQueue ( ) #NEWLINE# self . PRI_HIGH_START = 10 #NEWLINE# self . PRI_MEDIUM_START = 20 #NEWLINE# self . PRI_LOW_START = 30 #NEWLINE# self . _gateway_mac = cfg . dcnm . gateway_mac #NEWLINE# self . dcnm_dhcp = ( cfg . dcnm . dcnm_dhcp . lower ( ) == 'true' ) #NEWLINE# self . dcnm_client = cdr . DFARESTClient ( cfg ) #NEWLINE# self . keystone_event = deh . EventsHandler ( 'keystone' , self . pqueue , self . PRI_HIGH_START , self . PRI_LOW_START ) #NEWLINE# self . neutron_event = deh . EventsHandler ( 'neutron' , self . pqueue , self . PRI_MEDIUM_START , ( self . PRI_MEDIUM_START + 5 ) ) #NEWLINE# self . _inst_api = dfa_inst . DFAInstanceAPI ( ) #NEWLINE# self . ser_q = constants . DFA_SERVER_QUEUE #NEWLINE# self . _setup_rpc ( ) #NEWLINE# if ( not self . dcnm_dhcp ) : #NEWLINE# #INDENT# self . turn_on_dhcp_check ( ) #NEWLINE# self . events . update ( { #NEWLINE# #INDENT# 'dhcp_agent.network.remove' : self . dhcp_agent_network_remove , #NEWLINE# 'dhcp_agent.network.add' : self . dhcp_agent_network_add , #NEWLINE# #UNINDENT# } ) #NEWLINE# LOG . debug ( 'Using internal DHCP' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . dhcp_consist_check = 0 #NEWLINE# LOG . debug ( 'Using DCNM DHCP' )