And the code path that populates address_scope information does so based on a relation to a particular subnet because there is a check for fixed ip assignment:
* this check is performed after a gateway port is created and persisted to the neutron DB;
* when port has a binding to a host, e.g. 'binding:host_id': u'pillan';
* when vif_type is unbound: 'binding:vif_type': u'unbound'
After a gateway port gets created it is marked as unbound:
'binding:vif_type': u'unbound'
https:/ /github. com/openstack/ neutron/ blob/fbe308bdc1 2191c187343b5ef 103dea9af738380 /neutron/ db/l3_db. py#L1744- L1778 port_having_ fixed_ips( ports):
for port in self._each_
And the code path that populates address_scope information does so based on a relation to a particular subnet because there is a check for fixed ip assignment:
https:/ /github. com/openstack/ neutron/ blob/fbe308bdc1 2191c187343b5ef 103dea9af738380 /neutron/ db/l3_db. py#L1684 having_ fixed_ips
_each_port_
* this check is performed after a gateway port is created and persisted to the neutron DB;
* when port has a binding to a host, e.g. 'binding:host_id': u'pillan';
* when vif_type is unbound: 'binding:vif_type': u'unbound'
So, this code path
sync_routers /github. com/openstack/ neutron/ blob/fbe308bdc1 2191c187343b5ef 103dea9af738380 /neutron/ api/rpc/ handlers/ l3_rpc. py#L126- L129
https:/
def _ensure_ host_set_ on_ports( self, context, host, routers): host_set_ on_ports /github. com/openstack/ neutron/ blob/fbe308bdc1 2191c187343b5ef 103dea9af738380 /neutron/ api/rpc/ handlers/ l3_rpc. py#L131- L147 get('gw_ port') and router. get('distribute d'):
self. _ensure_ host_set_ on_port( context,
_ensure_
https:/
if router.
...
def _ensure_ host_set_ on_port( self, context, host, port, router_id=None,
ha_ router_ port=False) : /github. com/openstack/ neutron/ blob/fbe308bdc1 2191c187343b5ef 103dea9af738380 /neutron/ api/rpc/ handlers/ l3_rpc. py#L181- L187
self. plugin. update_ port(
context,
port[ 'id'],
{'port' : {portbindings. HOST_ID: host}})
https:/
which calls update_port in ML2 plugin
neutron/ plugins/ ml2/plugin. py|1295| def update_port(self, context, id, port):
Should take care of binding.