#NEWLINE# def single( self , table , request , instance_id ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# targets = api . network . floating_ip_target_list_by_instance ( request , instance_id ) #NEWLINE# target_ids = [ t . split ( '_' ) [ 0 ] for t in targets ] #NEWLINE# fips = [ fip for fip in api . network . tenant_floating_ip_list ( request ) if ( fip . port_id in target_ids ) ] #NEWLINE# if fips : #NEWLINE# #INDENT# fip = fips . pop ( ) #NEWLINE# api . network . floating_ip_disassociate ( request , fip . id ) #NEWLINE# messages . success ( request , ( _ ( 'Successfully disassociated floating IP: %s' ) % fip . ip ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# messages . info ( request , _ ( 'No floating IPs to disassociate.' ) ) #NEWLINE# #UNINDENT# #UNINDENT# except Exception : #NEWLINE# #INDENT# exceptions . handle ( request , _ ( 'Unable to disassociate floating IP.' ) ) #NEWLINE# #UNINDENT# return shortcuts . redirect ( request . get_full_path ( ) )