#NEWLINE# def _validate_port_for_update( self , context , db_port , new_port , new_mac ) : #NEWLINE# #INDENT# changed_owner = ( 'device_owner' in new_port ) #NEWLINE# current_owner = ( new_port . get ( 'device_owner' ) or db_port [ 'device_owner' ] ) #NEWLINE# changed_device_id = ( new_port . get ( 'device_id' ) != db_port [ 'device_id' ] ) #NEWLINE# current_device_id = ( new_port . get ( 'device_id' ) or db_port [ 'device_id' ] ) #NEWLINE# if ( ( current_owner and changed_device_id ) or changed_owner ) : #NEWLINE# #INDENT# self . _enforce_device_owner_not_router_intf_or_device_id ( context , current_owner , current_device_id , db_port [ 'tenant_id' ] ) #NEWLINE# #UNINDENT# if ( new_mac and ( new_mac != db_port [ 'mac_address' ] ) ) : #NEWLINE# #INDENT# self . _check_mac_addr_update ( context , db_port , new_mac , current_owner )