'Update allowed address pairs on port.
Returns True if an update notification is required. Notification
is not done here because other changes on the port may need
notification. This method is expected to be called within
a transaction.'

def update_address_pairs_on_port(self, context, port_id, port, original_port, updated_port):

    new_pairs = port['port'].get(addr_pair.ADDRESS_PAIRS)
    if self.is_address_pairs_attribute_updated(original_port, port['port']):
        updated_port[addr_pair.ADDRESS_PAIRS] = new_pairs
        self._delete_allowed_address_pairs(context, port_id)
        self._process_create_allowed_address_pairs(context, updated_port, new_pairs)
        return True
    return False
