[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:14 UTC 2013


The following commit has been merged in the master branch:
commit a4010e088eed3be16944af9c8abca2efd06ebd38
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Mon Feb 18 23:18:48 2013 -0800

    Port RemoveUserFromGroup

diff --git a/bin/euare-groupremoveuser b/bin/euare-groupremoveuser
index 7fc92be..7fae3c1 100755
--- a/bin/euare-groupremoveuser
+++ b/bin/euare-groupremoveuser
@@ -1,7 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
 
 import euca2ools.commands.euare.removeuserfromgroup
 
 if __name__ == '__main__':
-    r = euca2ools.commands.euare.removeuserfromgroup.RemoveUserFromGroup()
-    r.main_cli()
+    euca2ools.commands.euare.removeuserfromgroup.RemoveUserFromGroup.run()
diff --git a/euca2ools/commands/euare/removeuserfromgroup.py b/euca2ools/commands/euare/removeuserfromgroup.py
index 5ab6f05..0c01876 100644
--- a/euca2ools/commands/euare/removeuserfromgroup.py
+++ b/euca2ools/commands/euare/removeuserfromgroup.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,50 +27,24 @@
 # 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 RemoveUserFromGroup(AWSQueryRequest):
 
-    ServiceClass = euca2ools.commands.euare.Euare
+from requestbuilder import Arg
+from . import EuareRequest, DELEGATE
 
-    Description = """RemoveUserFromGroup"""
-    Params = [Param(
-        name='GroupName',
-        short_name='g',
-        long_name='group-name',
-        ptype='string',
-        optional=False,
-        doc=""" Name of the group to update. """,
-        ), Param(
-        name='UserName',
-        short_name='u',
-        long_name='user-name',
-        ptype='string',
-        optional=False,
-        doc=""" Name of the User to remove. """,
-        ), 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):
-        pass
-    
-    def main(self, **args):
-        return self.send(**args)
+class RemoveUserFromGroup(EuareRequest):
+    DESCRIPTION = 'Remove a user from a group'
+    ARGS = [Arg('-u', '--user-name', metavar='USER', action='append',
+                route_to=None, required=True,
+                help='user to remove from the group (required)'),
+            Arg('-g', '--group-name', dest='GroupName', metavar='GROUP',
+                required=True, help='group to remove the user from (required)'),
+            DELEGATE]
 
-    def main_cli(self):
-        euca2ools.utils.print_version_if_necessary()
-        self.do_cli()
+    def main(self):
+        for user in self.args['user_name']:
+            self.params['UserName'] = user
+            response = self.send()
+        # The response doesn't actually contain anything of interest, so just
+        # return whatever
+        return response

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list