[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:21 UTC 2013
The following commit has been merged in the master branch:
commit 70dddbfaf3791578af74f7e1c92bd1233cd177c3
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date: Tue Feb 19 17:37:03 2013 -0800
Port GetAccountSummary
diff --git a/bin/euare-accountgetsummary b/bin/euare-accountgetsummary
index 7c1edd6..2cfc6e4 100755
--- a/bin/euare-accountgetsummary
+++ b/bin/euare-accountgetsummary
@@ -1,7 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
import euca2ools.commands.euare.getaccountsummary
if __name__ == '__main__':
- r = euca2ools.commands.euare.getaccountsummary.GetAccountSummary()
- r.main_cli()
+ euca2ools.commands.euare.getaccountsummary.GetAccountSummary.run()
diff --git a/euca2ools/commands/euare/getaccountsummary.py b/euca2ools/commands/euare/getaccountsummary.py
index c301b5e..b3f73a4 100644
--- a/euca2ools/commands/euare/getaccountsummary.py
+++ b/euca2ools/commands/euare/getaccountsummary.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,40 +27,17 @@
# 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: 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 GetAccountSummary(AWSQueryRequest):
-
- ServiceClass = euca2ools.commands.euare.Euare
- Name = 'GetAccountSummary'
- Description = 'Retrieve account-level information'
- Params = [
- 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 data:
- for entry in data.SummaryMap:
- print '%s: %s' % (entry['key'], entry['value'])
- def main(self, **args):
- self.list_markers = ['SummaryMap']
- self.item_markers = ['entry']
- return self.send(**args)
+class GetAccountSummary(EuareRequest):
+ DESCRIPTION = '''Display account-level information about account entity
+ usage and IAM quotas'''
+ PARAMS = [DELEGATE]
+ LIST_MARKERS = ['SummaryMap']
- def main_cli(self):
- euca2ools.utils.print_version_if_necessary()
- self.do_cli()
+ def print_result(self, result):
+ for entry in sorted(result.get('SummaryMap', [])):
+ print '{0}: {1}'.format(entry.get('key'), entry.get('value'))
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list