[pkg-eucalyptus-commits] [SCM] managing cloud instances for Eucalyptus branch, master, updated. 3.0.0-alpha3-257-g1da8e3a

mdshaonimran mdshaonimran at gmail.com
Sun Jun 16 02:30:04 UTC 2013


The following commit has been merged in the master branch:
commit 69dfb3d3d80031917e1b3402b0659742753268f3
Author: mdshaonimran <mdshaonimran at gmail.com>
Date:   Tue Feb 12 18:48:44 2013 +0600

    euare-userlistkeys ported (poorly?)

diff --git a/bin/euare-userlistkeys b/bin/euare-userlistkeys
index d26907b..8fd0cd6 100755
--- a/bin/euare-userlistkeys
+++ b/bin/euare-userlistkeys
@@ -1,7 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
 
 import euca2ools.commands.euare.listaccesskeys
 
 if __name__ == '__main__':
-    r = euca2ools.commands.euare.listaccesskeys.ListAccessKeys()
-    r.main_cli()
+    euca2ools.commands.euare.listaccesskeys.ListAccessKeys.run()
diff --git a/euca2ools/commands/euare/listaccesskeys.py b/euca2ools/commands/euare/listaccesskeys.py
index 9575134..8ac7ded 100644
--- a/euca2ools/commands/euare/listaccesskeys.py
+++ b/euca2ools/commands/euare/listaccesskeys.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,61 +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 ListAccessKeys(AWSQueryRequest):
-
-    ServiceClass = euca2ools.commands.euare.Euare
 
-    Description = """ListAccessKeys"""
-    Params = [Param(
-        name='UserName',
-        short_name='u',
-        long_name='user-name',
-        ptype='string',
-        optional=True,
-        doc=""" Name of the User. """,
-        ), Param(
-        name='Marker',
-        short_name='m',
-        long_name='marker',
-        ptype='string',
-        optional=True,
-        doc=""" Use this 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 only when paginating results to indicate the maximum number of keys you want in the response. If there are additional keys 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. """,
-        )]
+from requestbuilder import Arg
+from . import EuareRequest, DELEGATE
 
-    def cli_formatter(self, data):
-        for key in data.AccessKeyMetadata:
-            print key['AccessKeyId']
-            print key['Status']
+class ListAccessKeys(EuareRequest):
+    DESCRIPTION = 'Returns information about the Access Key IDs associated with the specified user.'
+    ARGS = [Arg('-u', '--user-name', dest='UserName', metavar='USERNAME',
+                help='''Name of the User.'''),
+            DELEGATE]
 
-    def main(self, **args):
-        self.list_markers.append('AccessKeyMetadata')
-        self.item_markers.append('member')
-        return self.send(**args)
+    LIST_MARKERS = ['AccessKeyMetadata']
 
-    def main_cli(self):
-        euca2ools.utils.print_version_if_necessary()
-        self.do_cli()
+    def print_result(self, result):
+        for accesskey in result.get('AccessKeyMetadata', []):
+            print accesskey['AccessKeyId']
+            print accesskey['Status']

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list