[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:29:40 UTC 2013
The following commit has been merged in the master branch:
commit 15957708cbe70e5d07578f4ea6a1e3dea467cd0a
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Sat Apr 14 13:54:37 2012 -0700
Rewrite ListUsers
diff --git a/bin/euare-userlistbypath b/bin/euare-userlistbypath
index 0f1f95a..999a5d3 100755
--- a/bin/euare-userlistbypath
+++ b/bin/euare-userlistbypath
@@ -1,7 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
import euca2ools.commands.euare.listusers
if __name__ == '__main__':
- r = euca2ools.commands.euare.listusers.ListUsers()
- r.main_cli()
+ euca2ools.commands.euare.listusers.ListUsers().do_cli()
diff --git a/euca2ools/commands/euare/listusers.py b/euca2ools/commands/euare/listusers.py
index f4ec7e9..ad04379 100644
--- a/euca2ools/commands/euare/listusers.py
+++ b/euca2ools/commands/euare/listusers.py
@@ -1,6 +1,6 @@
# Software License Agreement (BSD License)
#
-# Copyright (c) 2009-2011, Eucalyptus Systems, Inc.
+# Copyright (c) 2009-2012, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
@@ -27,60 +27,19 @@
# 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 ListUsers(AWSQueryRequest):
+from requestbuilder import Arg
+from . import EuareRequest, DELEGATE
- ServiceClass = euca2ools.commands.euare.Euare
+class ListUsers(EuareRequest):
+ Description = 'List users under a specific path prefix'
+ Args = [Arg('-p', '--path-prefix', dest='PathPrefix', metavar='PREFIX',
+ help='''limit results to users who begin with a given path
+ (default: list all users)'''),
+ DELEGATE]
+ ListMarkers = ['Users']
+ ItemMarkers = ['member']
- Description = """ListUsers"""
- Params = [Param(
- name='PathPrefix',
- short_name='p',
- long_name='path-prefix',
- ptype='string',
- optional=True,
- doc=""" The path prefix for filtering the results. For example: /division_abc/subdivision_xyz/, which would get all User names whose path starts with /division_abc/subdivision_xyz/. This parameter is optional. If it is not included, it defaults to a slash (/), listing all User names. """,
- ), Param(
- name='Marker',
- short_name='m',
- long_name='marker',
- ptype='string',
- optional=True,
- doc=""" Use this parameter only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received. """,
- ), Param(
- name='MaxItems',
- short_name=None,
- long_name='max-items',
- ptype='integer',
- optional=True,
- doc=""" Use this parameter only when paginating results to indicate the maximum number of User names you want in the response. If there are additional User names beyond the maximum you specify, the IsTruncated response element is true. """,
- ), 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. """,
- )]
-
- def cli_formatter(self, data):
- for user in data.Users:
+ def print_result(self, result):
+ for user in result.get('Users', []):
print user['Arn']
-
- def main(self, **args):
- self.list_markers.append('Users')
- self.item_markers.append('member')
- return self.send(**args)
-
- def main_cli(self):
- euca2ools.utils.print_version_if_necessary()
- self.do_cli()
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list