Ensure to count firewalls in target tenant
Previously admin tenant cannot create a firewall if other tenant already created a firewall. We need to count firewalls only in a target tenant. Change-Id: I3e6d151d00d4a487bdd858e94929fab8960511a2 Closes-Bug: #1258438
This commit is contained in:
@@ -225,7 +225,8 @@ class FirewallPlugin(firewall_db.Firewall_db_mixin):
|
||||
LOG.debug(_("create_firewall() called"))
|
||||
tenant_id = self._get_tenant_id_for_create(context,
|
||||
firewall['firewall'])
|
||||
fw_count = self.get_firewalls_count(context)
|
||||
fw_count = self.get_firewalls_count(context,
|
||||
filters={'tenant_id': [tenant_id]})
|
||||
if fw_count:
|
||||
raise FirewallCountExceeded(tenant_id=tenant_id)
|
||||
firewall['firewall']['status'] = const.PENDING_CREATE
|
||||
|
||||
Reference in New Issue
Block a user