[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 53e402baa9c1985ba06c69195448ca64a97305cb
Author: mdshaonimran <mdshaonimran at gmail.com>
Date: Tue Feb 12 16:38:32 2013 +0600
euare-accountlist ported
diff --git a/bin/euare-accountlist b/bin/euare-accountlist
index 40d3272..1ce2134 100755
--- a/bin/euare-accountlist
+++ b/bin/euare-accountlist
@@ -1,7 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
import euca2ools.commands.euare.listaccounts
if __name__ == '__main__':
- r = euca2ools.commands.euare.listaccounts.ListAccounts()
- r.main_cli()
+ euca2ools.commands.euare.listaccounts.ListAccounts.run()
diff --git a/euca2ools/commands/euare/listaccounts.py b/euca2ools/commands/euare/listaccounts.py
index a50f5c1..9591438 100644
--- a/euca2ools/commands/euare/listaccounts.py
+++ b/euca2ools/commands/euare/listaccounts.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,32 +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: 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 ListAccounts(AWSQueryRequest):
-
- ServiceClass = euca2ools.commands.euare.Euare
- Name = 'ListAccounts'
- Description = 'List accounts in the system.'
- def cli_formatter(self, data):
- for account in data.Accounts:
- print account['AccountName'], '\t', account['AccountId']
+from requestbuilder import Arg
+from . import EuareRequest, DELEGATE
+from requestbuilder.mixins import TabifyingCommand
- def main(self, **args):
- self.list_markers.append('Accounts')
- self.item_markers.append('member')
- return self.send(**args)
+class ListAccounts(EuareRequest, TabifyingCommand):
+ DESCRIPTION = 'List accounts in the system.'
+
+ LIST_MARKERS = ['Accounts']
- def main_cli(self):
- euca2ools.utils.print_version_if_necessary()
- self.do_cli()
+ def print_result(self, result):
+ for account in result.get('Accounts', []):
+ print self.tabify((account.get('AccountName'), account.get('AccountId')))
--
managing cloud instances for Eucalyptus
More information about the pkg-eucalyptus-commits
mailing list