From ea2dd8e141ef1cf446a42ee93992d8fb44f4ba05 Mon Sep 17 00:00:00 2001 From: Richard Theis Date: Tue, 1 Mar 2016 15:34:35 -0600 Subject: Refactor security group create to use SDK Refactored the 'os security group create' command to use the SDK when neutron is enabled, but continue to use the nova client when nova network is enabled. Added a release note for the change in security group rules output due to Network v2. The tenant_id column name was fixed to align with the 'os security group show' command. Change-Id: Ib29df42edcddcc73a123fff6a64743a6bfcb7fbf Partial-Bug: #1519511 Implements: blueprint neutron-client --- openstackclient/compute/v2/security_group.py | 32 ---------------------------- 1 file changed, 32 deletions(-) (limited to 'openstackclient/compute') diff --git a/openstackclient/compute/v2/security_group.py b/openstackclient/compute/v2/security_group.py index 042e5caf..734bd78e 100644 --- a/openstackclient/compute/v2/security_group.py +++ b/openstackclient/compute/v2/security_group.py @@ -56,38 +56,6 @@ def _xform_security_group_rule(sgroup): return info -class CreateSecurityGroup(command.ShowOne): - """Create a new security group""" - - def get_parser(self, prog_name): - parser = super(CreateSecurityGroup, self).get_parser(prog_name) - parser.add_argument( - "name", - metavar="", - help="New security group name", - ) - parser.add_argument( - "--description", - metavar="", - help="Security group description", - ) - return parser - - def take_action(self, parsed_args): - compute_client = self.app.client_manager.compute - - description = parsed_args.description or parsed_args.name - - data = compute_client.security_groups.create( - parsed_args.name, - description, - ) - - info = {} - info.update(data._info) - return zip(*sorted(six.iteritems(info))) - - class CreateSecurityGroupRule(command.ShowOne): """Create a new security group rule""" -- cgit v1.2.1