#NEWLINE# def _create_sub_interface( self , ri , port , is_external = False , gw_ip = '' ) : #NEWLINE# #INDENT# vlan = self . _get_interface_vlan_from_hosting_port ( port ) #NEWLINE# if ( self . _fullsync and ( int ( gw_ip ) in self . _existing_cfg_dict [ 'interfaces' ] ) ) : #NEWLINE# #INDENT# LOG . info ( _LI ( 'Sub-interface already exists, skipping' ) ) #NEWLINE# return #NEWLINE# #UNINDENT# vrf_name = self . _get_vrf_name ( ri ) #NEWLINE# net_mask = netaddr . IPNetwork ( port [ 'ip_cidr' ] ) . netmask #NEWLINE# hsrp_ip = port [ 'fixed_ips' ] [ 0 ] [ 'ip_address' ] #NEWLINE# sub_interface = self . _get_interface_name_from_hosting_port ( port ) #NEWLINE# self . _do_create_sub_interface ( sub_interface , vlan , vrf_name , hsrp_ip , net_mask , is_external ) #NEWLINE# if ri . router . get ( ha . ENABLED , False ) : #NEWLINE# #INDENT# if ( port . get ( ha . HA_INFO ) is not None ) : #NEWLINE# #INDENT# self . _add_ha_hsrp ( ri , port ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# params = { #NEWLINE# #INDENT# 'r_id' : ri . router_id , #NEWLINE# 'p_id' : port [ 'id' ] , #NEWLINE# 'port' : port , #NEWLINE# #UNINDENT# } #NEWLINE# raise cfg_exc . HAParamsMissingException ( ** params )