#NEWLINE# def floating_ip_removed_dist( self , fip_cidr ) : #NEWLINE# #INDENT# 'Remove floating IP from FIP namespace.' #NEWLINE# floating_ip = fip_cidr . split ( '/' ) [ 0 ] #NEWLINE# rtr_2_fip_name = self . fip_ns . get_rtr_ext_device_name ( self . router_id ) #NEWLINE# fip_2_rtr_name = self . fip_ns . get_int_device_name ( self . router_id ) #NEWLINE# if ( self . rtr_fip_subnet is None ) : #NEWLINE# #INDENT# self . rtr_fip_subnet = self . fip_ns . local_subnets . allocate ( self . router_id ) #NEWLINE# #UNINDENT# ( rtr_2_fip , fip_2_rtr ) = self . rtr_fip_subnet . get_pair ( ) #NEWLINE# fip_ns_name = self . fip_ns . get_name ( ) #NEWLINE# if ( floating_ip in self . floating_ips_dict ) : #NEWLINE# #INDENT# rule_pr = self . floating_ips_dict [ floating_ip ] #NEWLINE# ip_rule = ip_lib . IPRule ( namespace = self . ns_name ) #NEWLINE# ip_rule . rule . delete ( ip = floating_ip , table = dvr_fip_ns . FIP_RT_TBL , priority = rule_pr ) #NEWLINE# self . fip_ns . deallocate_rule_priority ( floating_ip ) #NEWLINE# #UNINDENT# device = ip_lib . IPDevice ( fip_2_rtr_name , namespace = fip_ns_name ) #NEWLINE# device . route . delete_route ( fip_cidr , str ( rtr_2_fip . ip ) ) #NEWLINE# self . dist_fip_count = ( self . dist_fip_count - 1 ) #NEWLINE# if ( self . dist_fip_count == 0 ) : #NEWLINE# #INDENT# device = ip_lib . IPDevice ( rtr_2_fip_name , namespace = self . ns_name ) #NEWLINE# ns_ip = ip_lib . IPWrapper ( namespace = fip_ns_name ) #NEWLINE# device . route . delete_gateway ( str ( fip_2_rtr . ip ) , table = dvr_fip_ns . FIP_RT_TBL ) #NEWLINE# self . fip_ns . local_subnets . release ( self . router_id ) #NEWLINE# self . rtr_fip_subnet = None #NEWLINE# ns_ip . del_veth ( ip_rule )