#NEWLINE# def add_fixed_ip_to_instance( self , context , instance_id , host , network_id , rxtx_factor = None ) : #NEWLINE# #INDENT# 'Adds a fixed IP to an instance from specified network.' #NEWLINE# if uuidutils . is_uuid_like ( network_id ) : #NEWLINE# #INDENT# network = self . get_network ( context , network_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# network = self . _get_network_by_id ( context , network_id ) #NEWLINE# #UNINDENT# LOG . debug ( 'Add fixed IP on network %s' , network [ 'uuid' ] , instance_uuid = instance_id ) #NEWLINE# self . _allocate_fixed_ips ( context , instance_id , network_id , [ network ] ) #NEWLINE# return self . get_instance_nw_info ( context , instance_id , rxtx_factor , host )