#NEWLINE# def fake_fixed_ip_associate_pool( context , network_id , instance_id ) : #NEWLINE# #INDENT# ips = [ i for i in fixed_ips if ( ( not i [ 'instance' ] ) and ( ( i [ 'network_id' ] == network_id ) or ( i [ 'network_id' ] is None ) ) ) ] #NEWLINE# if ( not ips ) : #NEWLINE# #INDENT# raise exception . NoMoreFixedIps ( net = network_id ) #NEWLINE# #UNINDENT# ips [ 0 ] [ 'instance' ] = True #NEWLINE# ips [ 0 ] [ 'instance_id' ] = instance_id #NEWLINE# return ips [ 0 ] [ 'address' ]