#NEWLINE# def update_port( self , context , id , port ) : #NEWLINE# #INDENT# new_port = port [ 'port' ] #NEWLINE# with context . session . begin ( subtransactions = True ) : #NEWLINE# #INDENT# port = self . _get_port ( context , id ) #NEWLINE# if ( 'dns-integration' in self . supported_extension_aliases ) : #NEWLINE# #INDENT# original_ips = self . _make_fixed_ip_dict ( port [ 'fixed_ips' ] ) #NEWLINE# original_dns_name = port . get ( 'dns_name' , '' ) #NEWLINE# request_dns_name = self . _get_request_dns_name ( new_port ) #NEWLINE# if ( ( 'dns_name' in new_port ) and ( not request_dns_name ) ) : #NEWLINE# #INDENT# new_port [ 'dns_name' ] = '' #NEWLINE# #UNINDENT# #UNINDENT# new_mac = new_port . get ( 'mac_address' ) #NEWLINE# self . _validate_port_for_update ( context , port , new_port , new_mac ) #NEWLINE# changes = self . ipam . update_port_with_ips ( context , port , new_port , new_mac ) #NEWLINE# if ( 'dns-integration' in self . supported_extension_aliases ) : #NEWLINE# #INDENT# dns_assignment = self . _get_dns_names_for_updated_port ( context , original_ips , original_dns_name , request_dns_name , changes ) #NEWLINE# #UNINDENT# #UNINDENT# result = self . _make_port_dict ( port ) #NEWLINE# if ( changes . original or changes . add or changes . remove ) : #NEWLINE# #INDENT# result [ 'fixed_ips' ] = self . _make_fixed_ip_dict ( ( changes . original + changes . add ) ) #NEWLINE# #UNINDENT# if ( 'dns-integration' in self . supported_extension_aliases ) : #NEWLINE# #INDENT# result [ 'dns_assignment' ] = dns_assignment #NEWLINE# #UNINDENT# return result