Error handling for update operations (update_network, update_port, and update_subnet) are not implemented yet and are marked as TODO items. Here is the TODO comment for update_network:
# TODO(apech) - handle errors raised by update_network, potentially
# by re-calling update_network with the previous attributes. For
# now the error is propogated to the caller, which is expected to
# either undo/retry the operation or delete the resource.
Since here we need to deal with errors raised by update_network_postcommit (all other errors were caught earlier), shouldn't the assumption be that the mechanism driver has to deal with its own rollback? Here we only need to rollback the operations performed by the plugin (such as the db update). If that is the case, then recalling update_network won't be what we need. Recalling update_network may also lead to an infinite loop.
One possible solution would be something like this:
try:
self.mechanism_manager.update_network_postcommit(mech_context)
except ml2_exc.MechanismDriverError:
# rollback the db using the original network info and
# similarly deal with _process_l3_update, etc
Perhaps similar or better solutions are in the works by apech and others. If not and if this approach sounds reasonable I can make the changes.
Fix proposed to branch: master /review. openstack. org/69792
Review: https:/