#NEWLINE# def _make_vm_info( self , port , status , dhcp_port = False ) : #NEWLINE# #INDENT# port_id = port . get ( 'id' ) #NEWLINE# device_id = port . get ( 'device_id' ) . replace ( '-' , '' ) #NEWLINE# tenant_id = port . get ( 'tenant_id' ) #NEWLINE# net_id = port . get ( 'network_id' ) #NEWLINE# inst_ip = '0.0.0.0' #NEWLINE# inst_name = self . _inst_api . get_instance_for_uuid ( device_id , tenant_id ) #NEWLINE# segid = ( ( ( net_id in self . network ) and self . network [ net_id ] . get ( 'segmentation_id' ) ) or 0 ) #NEWLINE# fwd_mod = ( ( ( net_id in self . network ) and self . network [ net_id ] . get ( 'fwd_mod' ) ) or 'anycast-gateway' ) #NEWLINE# gw_mac = ( self . _gateway_mac if ( fwd_mod == 'proxy-gateway' ) else None ) #NEWLINE# vm_mac = port . get ( 'mac_address' ) #NEWLINE# if ( not self . dcnm_dhcp ) : #NEWLINE# #INDENT# fixed_ip = port . get ( 'fixed_ips' ) #NEWLINE# inst_ip = fixed_ip [ 0 ] . get ( 'ip_address' ) #NEWLINE# if dhcp_port : #NEWLINE# #INDENT# inst_name = ( ( ( 'dhcp-' + str ( segid ) ) + '-' ) + inst_ip . split ( '.' ) [ 3 ] ) #NEWLINE# device_id = port_id #NEWLINE# #UNINDENT# #UNINDENT# vm_info = dict ( status = status , vm_mac = vm_mac , segmentation_id = segid , host = port . get ( 'binding:host_id' ) , port_uuid = port_id , net_uuid = port . get ( 'network_id' ) , oui = dict ( ip_addr = inst_ip , vm_name = inst_name , vm_uuid = device_id , gw_mac = gw_mac , fwd_mod = fwd_mod , oui_id = 'cisco' ) ) #NEWLINE# return vm_info