Support description in sg-rule creation

Story: 2008876
Task: 42420
Signed-off-by: Jesper Schmitz Mouridsen <jesper@schmitz.computer>
Change-Id: I9e2ab6015155dd2e67788f515fd42231fcf98547
This commit is contained in:
Jesper Schmitz Mouridsen 2021-10-03 10:16:39 +02:00
parent 806a525733
commit 15a8fc4c26

View File

@ -241,7 +241,8 @@ class SecurityGroupCloudMixin(_normalize.Normalizer):
remote_address_group_id=None,
direction='ingress',
ethertype='IPv4',
project_id=None):
project_id=None,
description=None):
"""Create a new security group rule
:param string secgroup_name_or_id:
@ -285,7 +286,8 @@ class SecurityGroupCloudMixin(_normalize.Normalizer):
:param string project_id:
Specify the project ID this security group will be created
on (admin-only).
:param string description:
Description of the rule, max 255 characters.
:returns: A ``munch.Munch`` representing the new security group rule.
:raises: OpenStackCloudException on operation error.
@ -319,7 +321,8 @@ class SecurityGroupCloudMixin(_normalize.Normalizer):
}
if project_id is not None:
rule_def['tenant_id'] = project_id
if description is not None:
rule_def["description"] = description
return self.network.create_security_group_rule(
**rule_def
)