diff options
| author | Zuul <zuul@review.opendev.org> | 2021-05-26 19:29:11 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2021-05-26 19:29:11 +0000 |
| commit | 443c311fc288eefe1b9223b6b51a94121ab9d301 (patch) | |
| tree | 801155f8e1346c03fb80b4b51917b17eb62e47f0 /openstackclient/network/v2/security_group.py | |
| parent | 84a606be675902d75a60efaf46305f670f26548f (diff) | |
| parent | b26b7f3440d4f756c0b7906b93751d7e83a733f7 (diff) | |
| download | python-openstackclient-443c311fc288eefe1b9223b6b51a94121ab9d301.tar.gz | |
Merge "Allow to send extra attributes in Neutron related commands"
Diffstat (limited to 'openstackclient/network/v2/security_group.py')
| -rw-r--r-- | openstackclient/network/v2/security_group.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/openstackclient/network/v2/security_group.py b/openstackclient/network/v2/security_group.py index 0732c23e..49dc14e4 100644 --- a/openstackclient/network/v2/security_group.py +++ b/openstackclient/network/v2/security_group.py @@ -95,7 +95,8 @@ def _get_columns(item): # TODO(abhiraut): Use the SDK resource mapped attribute names once the # OSC minimum requirements include SDK 1.0. -class CreateSecurityGroup(common.NetworkAndComputeShowOne): +class CreateSecurityGroup(common.NetworkAndComputeShowOne, + common.NeutronCommandWithExtraArgs): _description = _("Create a new security group") def update_parser_common(self, parser): @@ -160,6 +161,8 @@ class CreateSecurityGroup(common.NetworkAndComputeShowOne): parsed_args.project_domain, ).id attrs['tenant_id'] = project_id + attrs.update( + self._parse_extra_properties(parsed_args.extra_properties)) # Create the security group and display the results. obj = client.create_security_group(**attrs) @@ -310,7 +313,8 @@ class ListSecurityGroup(common.NetworkAndComputeLister): ) for s in data)) -class SetSecurityGroup(common.NetworkAndComputeCommand): +class SetSecurityGroup(common.NetworkAndComputeCommand, + common.NeutronCommandWithExtraArgs): _description = _("Set security group properties") def update_parser_common(self, parser): @@ -362,6 +366,8 @@ class SetSecurityGroup(common.NetworkAndComputeCommand): attrs['stateful'] = True if parsed_args.stateless: attrs['stateful'] = False + attrs.update( + self._parse_extra_properties(parsed_args.extra_properties)) # NOTE(rtheis): Previous behavior did not raise a CommandError # if there were no updates. Maintain this behavior and issue # the update. |
