#NEWLINE# @ wrap_check_policy #NEWLINE# @ base_api . refresh_cache #NEWLINE# def associate_floating_ip( self , context , instance , floating_address , fixed_address , affect_auto_assigned = False ) : #NEWLINE# #INDENT# 'Associates a floating IP with a fixed IP.\n\n        Ensures floating IP is allocated to the project in context.\n        Does not verify ownership of the fixed IP. Caller is assumed to have\n        checked that the instance is properly owned.\n\n        ' #NEWLINE# orig_instance_uuid = self . floating_manager . associate_floating_ip ( context , fixed_address , fixed_address , affect_auto_assigned ) #NEWLINE# if orig_instance_uuid : #NEWLINE# #INDENT# msg_dict = dict ( address = floating_address , instance_id = orig_instance_uuid ) #NEWLINE# LOG . info ( _LI ( 're-assign floating IP %(address)s from instance %(instance_id)s' ) , msg_dict ) #NEWLINE# orig_instance = objects . Instance . get_by_uuid ( context , orig_instance_uuid , expected_attrs = [ 'flavor' ] ) #NEWLINE# base_api . update_instance_cache_with_nw_info ( self , context , orig_instance )