Fix ML2 revision_number handling in port updates

The revision number is bumped on the flush that changes
the port or a resource that bumps the port. However, in ML2
we create the dict that is used for after_update events,
mech driver calls, and the API response before all resource
modifications are complete so the dict may not reflect
the correct revision number.

This adjusts the update_port_status to flush changes to the
DB before constructing the dictionary response to give the
event listener a chance to bump the revision.

It also adjusts ML2 to update the 'updated_port' dict with
the latest result from make_port_dict after all of the related
objects have been processed to ensure the result has the latest
info from extensions. The API test for allowed address pairs
was adjusted to stop checking for order on update since no order
is stored in the DB.

The API test for revision numbers and ports was updated to
expect the correct behavior.

Closes-Bug: #1625981
Change-Id: I49d2d79a57d484fd98b8969f511895e607b7f128
2 files changed
tree: f12f1fee472aff32612f9d10d038e77758b01d75
  1. neutron/