diff options
| author | Tang Chen <chen.tang@easystack.cn> | 2016-02-17 15:20:36 +0800 |
|---|---|---|
| committer | Tang Chen <chen.tang@easystack.cn> | 2016-02-27 03:47:57 +0800 |
| commit | 859bfaf8757086c8607c1520c8018ab20e91a3ac (patch) | |
| tree | 653ff6662c65366c92a8b41b16201d7bc0d49c1e /openstackclient | |
| parent | f37eda3a27dc88d3186d21eca328cca086ee3647 (diff) | |
| download | python-openstackclient-859bfaf8757086c8607c1520c8018ab20e91a3ac.tar.gz | |
Make SetSecurityGroup inherit from cliff.Command
set/unset comamnd classes should inherit from cliff.Command class.
Change-Id: Ie28711ac8823dc9eb13cf83877864ca436b928bc
Partial-Bug: 1546065
Diffstat (limited to 'openstackclient')
| -rw-r--r-- | openstackclient/compute/v2/security_group.py | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/openstackclient/compute/v2/security_group.py b/openstackclient/compute/v2/security_group.py index 6f2e1a52..2a7b40f4 100644 --- a/openstackclient/compute/v2/security_group.py +++ b/openstackclient/compute/v2/security_group.py @@ -271,7 +271,7 @@ class ListSecurityGroupRule(command.Lister): ) for s in rules)) -class SetSecurityGroup(command.ShowOne): +class SetSecurityGroup(command.Command): """Set security group properties""" def get_parser(self, prog_name): @@ -294,7 +294,6 @@ class SetSecurityGroup(command.ShowOne): return parser def take_action(self, parsed_args): - compute_client = self.app.client_manager.compute data = utils.find_resource( compute_client.security_groups, @@ -306,17 +305,11 @@ class SetSecurityGroup(command.ShowOne): if parsed_args.description: data.description = parsed_args.description - info = {} - info.update(compute_client.security_groups.update( + compute_client.security_groups.update( data, data.name, data.description, - )._info) - - if info: - return zip(*sorted(six.iteritems(info))) - else: - return ({}, {}) + ) class ShowSecurityGroup(command.ShowOne): |
