The linux bridge agent was calling ensure_port_admin state
unconditionally on ports in treat_devices_added_or_updated.
This would cause it to throw an error on interfaces that
didn't exist so it would restart the entire processing loop.
If another port was being updated in the same loop before this
one, that port would experience a port status life-cycle of
DOWN->BUILD->ACTIVE->BUILD->ACTIVE
^ <--- Exception in unrelated port causes cycle
to start over again.
This causes the bug below because the first active transition will
cause Nova to boot the VM. At this point tempest tests expect the
ports that belong to the VM to be in the ACTIVE state so it filters
Neutron port list calls with "status=ACTIVE". Therefore tempest would
not get any ports back and assume there was some kind of error with
the port and bail.
This patch just makes sure the admin state call is skipped if the port
doesn't exist and it includes a basic unit test to prevent a regression.
Closes-Bug: #1523638
Change-Id: I5330c6111cbb20bf45aec9ade7e30d34e8dd16ca