Modify the default SG rule count logic when creating SG
During the creation of SG, not to exceed the SG rule quota, the number of default SG rules that will be automatically created must be counted. It is always 2 (in case of the default SG, it is 4), but it is wrong since it depends on the default SG rules. Closes-Bug: #2067239 Change-Id: Ic86826b71c1160a6891f09ca1e40135049a8948a (cherry picked from commit 1a440dd61b04b37d0e2a9434e802f5a1ee3c198b)
This commit is contained in:
parent
32ef705e5b
commit
e8ac162720
@ -110,8 +110,12 @@ class SecurityGroupDbMixin(
|
||||
return self.get_security_group(context, existing_def_sg_id)
|
||||
|
||||
with db_api.CONTEXT_WRITER.using(context):
|
||||
delta = len(ext_sg.sg_supported_ethertypes)
|
||||
delta = delta * 2 if default_sg else delta
|
||||
if default_sg:
|
||||
delta = sg_default_rules_obj.SecurityGroupDefaultRule.count(
|
||||
context, used_in_default_sg=True)
|
||||
else:
|
||||
delta = sg_default_rules_obj.SecurityGroupDefaultRule.count(
|
||||
context, used_in_non_default_sg=True)
|
||||
quota.QUOTAS.quota_limit_check(context, tenant_id,
|
||||
security_group_rule=delta)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user