Add base support for update_port_bulk

As a complement to the create_port_bulk optimizations that took place in
the Stein cycle, create the ability to have an ML2 plugin optionally
expose an 'update_port_bulk' operation as well.  This will permit ML2
plugins to optimize this code path for bulk operations as well.

Change-Id: Id2c88a82715bccd1c23213828ef904322ab4386f
This commit is contained in:
Nate Johnston 2019-07-01 11:59:32 -04:00
parent 8b00349a63
commit 8b50a36341
1 changed files with 5 additions and 1 deletions

View File

@ -674,7 +674,11 @@ class Controller(object):
msg = _('The resource could not be found.')
raise webob.exc.HTTPNotFound(msg)
if self._native_bulk and hasattr(self._plugin, "%s_bulk" % action):
obj_updater = getattr(self._plugin, "%s_bulk" % action)
else:
obj_updater = getattr(self._plugin, action)
kwargs = {self._resource: body}
if parent_id:
kwargs[self._parent_id_name] = parent_id