From bac9fb18c1455f6a309e7acff9230a8d6bf7079b Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Wed, 2 Mar 2016 15:45:01 -0600 Subject: Refactor security group set to use SDK Refactored the 'os security group set' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. This patch set also fixes a compute bug which ignores name and description when set to an empty value. Change-Id: I4225179dca4aedf799e1656ec49236bdedc5e9bd Partial-Bug: #1519511 Implements: blueprint neutron-client --- openstackclient/compute/v2/security_group.py | 41 ---------------------------- 1 file changed, 41 deletions(-) (limited to 'openstackclient/compute') diff --git a/openstackclient/compute/v2/security_group.py b/openstackclient/compute/v2/security_group.py index 907175f7..f378af14 100644 --- a/openstackclient/compute/v2/security_group.py +++ b/openstackclient/compute/v2/security_group.py @@ -217,47 +217,6 @@ class ListSecurityGroupRule(command.Lister): ) for s in rules)) -class SetSecurityGroup(command.Command): - """Set security group properties""" - - def get_parser(self, prog_name): - parser = super(SetSecurityGroup, self).get_parser(prog_name) - parser.add_argument( - 'group', - metavar='', - help='Security group to modify (name or ID)', - ) - parser.add_argument( - '--name', - metavar='', - help='New security group name', - ) - parser.add_argument( - "--description", - metavar="", - help="New security group description", - ) - return parser - - def take_action(self, parsed_args): - compute_client = self.app.client_manager.compute - data = utils.find_resource( - compute_client.security_groups, - parsed_args.group, - ) - - if parsed_args.name: - data.name = parsed_args.name - if parsed_args.description: - data.description = parsed_args.description - - compute_client.security_groups.update( - data, - data.name, - data.description, - ) - - class ShowSecurityGroup(command.ShowOne): """Display security group details""" -- cgit v1.2.1