Prevent unnecessary database read by l3 agent
Fixes bug 1088129 Change-Id: I887facf321f3267c16c101a1448827f6c046bb2c
This commit is contained in:
parent
a607f0a232
commit
2e043a5a78
@ -864,6 +864,8 @@ class L3_NAT_db_mixin(l3.RouterPluginBase):
|
|||||||
my_ports = subnet_id_ports_dict.get(fixed_ip['subnet_id'], [])
|
my_ports = subnet_id_ports_dict.get(fixed_ip['subnet_id'], [])
|
||||||
my_ports.append(port)
|
my_ports.append(port)
|
||||||
subnet_id_ports_dict[fixed_ip['subnet_id']] = my_ports
|
subnet_id_ports_dict[fixed_ip['subnet_id']] = my_ports
|
||||||
|
if not subnet_id_ports_dict:
|
||||||
|
return
|
||||||
filters = {'id': subnet_id_ports_dict.keys()}
|
filters = {'id': subnet_id_ports_dict.keys()}
|
||||||
fields = ['id', 'cidr', 'gateway_ip']
|
fields = ['id', 'cidr', 'gateway_ip']
|
||||||
subnet_dicts = self.get_subnets(context, filters, fields)
|
subnet_dicts = self.get_subnets(context, filters, fields)
|
||||||
|
Loading…
Reference in New Issue
Block a user