Merge "Modify the default SG rule count logic when creating SG" into stable/2024.1
This commit is contained in:
commit
264306492f
@ -110,8 +110,12 @@ class SecurityGroupDbMixin(
|
|||||||
return self.get_security_group(context, existing_def_sg_id)
|
return self.get_security_group(context, existing_def_sg_id)
|
||||||
|
|
||||||
with db_api.CONTEXT_WRITER.using(context):
|
with db_api.CONTEXT_WRITER.using(context):
|
||||||
delta = len(ext_sg.sg_supported_ethertypes)
|
if default_sg:
|
||||||
delta = delta * 2 if default_sg else delta
|
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,
|
quota.QUOTAS.quota_limit_check(context, tenant_id,
|
||||||
security_group_rule=delta)
|
security_group_rule=delta)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user