[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a
Garrett Holmstrom
gholms at fedoraproject.org
Sun Jun 16 02:30:08 UTC 2013
The following commit has been merged in the master branch:
commit 0559d4bfbb8418ec8b40c8a8203e44ecb332383c
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Mon Feb 18 15:39:21 2013 -0800
Port CreateGroup
diff --git a/bin/euare-groupcreate b/bin/euare-groupcreate
index 24f7649..c156aef 100755
--- a/bin/euare-groupcreate
+++ b/bin/euare-groupcreate
@@ -1,7 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
import euca2ools.commands.euare.creategroup
if __name__ == '__main__':
- r = euca2ools.commands.euare.creategroup.CreateGroup()
- r.main_cli()
+ euca2ools.commands.euare.creategroup.CreateGroup.run()
diff --git a/euca2ools/commands/euare/creategroup.py b/euca2ools/commands/euare/creategroup.py
index b478937..9bb5896 100644
--- a/euca2ools/commands/euare/creategroup.py
+++ b/euca2ools/commands/euare/creategroup.py
@@ -1,6 +1,6 @@
# Software License Agreement (BSD License)
#
-# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
+# Copyright (c) 2009-2013, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
@@ -27,60 +27,22 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
-#
-# Author: Neil Soman neil at eucalyptus.com
-# Mitch Garnaat mgarnaat at eucalyptus.com
-
-from boto.roboto.awsqueryrequest import AWSQueryRequest
-from boto.roboto.param import Param
-import euca2ools.commands.euare
-import euca2ools.utils
-
-
-class CreateGroup(AWSQueryRequest):
-
- ServiceClass = euca2ools.commands.euare.Euare
- Description = """CreateGroup"""
- Params = [
- Param(name='Path',
- short_name='p',
- long_name='path',
- ptype='string',
- optional=True,
- doc=""" The path to the group. For more information about paths, \
- see Identifiers for IAM Entities in Using AWS Identity and \
- Access Management. This parameter is optional. If it is not \
- included, it defaults to a slash (/). """),
- Param(name='GroupName',
- short_name='g',
- long_name='group-name',
- ptype='string',
- optional=False,
- doc=""" Name of the group to create. Do not include the path in this value. """),
- Param(name='verbose',
- short_name='v',
- long_name='verbose',
- optional=True,
- ptype='boolean',
- default=False,
- request_param=False,
- doc="Causes the response to include the newly created group's ARN and GUID."),
- Param(name='DelegateAccount',
- short_name=None,
- long_name='delegate',
- ptype='string',
- optional=True,
- doc=""" [Eucalyptus extension] Process this command as if the administrator of the specified account had run it. This option is only usable by cloud administrators. """)]
+from requestbuilder import Arg
+from . import EuareRequest, DELEGATE
- def cli_formatter(self, data):
- if self.cli_options.verbose:
- print data.Arn
- print data.GroupId
- def main(self, **args):
- return self.send(**args)
+class CreateGroup(EuareRequest):
+ DESCRIPTION = 'Create a new group'
+ ARGS = [Arg('-g', '--group-name', dest='GroupName', metavar='GROUP',
+ required=True, help='name of the new group (required)'),
+ Arg('-p', '--path', dest='Path',
+ help='path for the new group (default: "/")'),
+ Arg('-v', '--verbose', action='store_true', route_to=None,
+ help="print the new group's ARN and GUID"),
+ DELEGATE]
- def main_cli(self):
- euca2ools.utils.print_version_if_necessary()
- self.do_cli()
+ def print_result(self, result):
+ if self.args['verbose']:
+ print result['Group']['Arn']
+ print result['Group']['GroupId']
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list