I'm not sure the proposal is valid, as the routers used in the first call to _routers_to_sync() are used inside the 'if' clause:
routers = self._routers_to_sync(context, router_ids, host)
if extensions.is_extension_supported( self.plugin, constants.PORT_BINDING_EXT_ALIAS): self._ensure_host_set_on_ports(context, host, routers)
# refresh the data structure after ports are bound
routers = self._routers_to_sync(context, router_ids, host)
Perhaps, and this is just a thought, _ensure_host_set_on_port() can return a status indicating it did some work and we can skip the second sync call if it didn't?
I'm not sure the proposal is valid, as the routers used in the first call to _routers_to_sync() are used inside the 'if' clause:
routers = self._routers_ to_sync( context, router_ids, host) is_extension_ supported(
self. plugin, constants. PORT_BINDING_ EXT_ALIAS) :
self. _ensure_ host_set_ on_ports( context, host, routers) to_sync( context, router_ids, host)
if extensions.
# refresh the data structure after ports are bound
routers = self._routers_
Perhaps, and this is just a thought, _ensure_ host_set_ on_port( ) can return a status indicating it did some work and we can skip the second sync call if it didn't?