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


The following commit has been merged in the master branch:
commit 1d47e4f1a448fe742576a3edfca7f3118775976b
Author: Garrett Holmstrom <gholms at fedoraproject.org>
Date:   Tue Feb 19 00:13:09 2013 -0800

    Port UpdateUser

diff --git a/bin/euare-usermod b/bin/euare-usermod
index 1e5deba..baed356 100755
--- a/bin/euare-usermod
+++ b/bin/euare-usermod
@@ -1,7 +1,6 @@
-#!/usr/bin/python
+#!/usr/bin/python -tt
 
 import euca2ools.commands.euare.updateuser
 
 if __name__ == '__main__':
-    r = euca2ools.commands.euare.updateuser.UpdateUser()
-    r.main_cli()
+    euca2ools.commands.euare.updateuser.UpdateUser.run()
diff --git a/euca2ools/commands/euare/updateuser.py b/euca2ools/commands/euare/updateuser.py
index 25cbcad..753c643 100644
--- a/euca2ools/commands/euare/updateuser.py
+++ b/euca2ools/commands/euare/updateuser.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,79 +27,27 @@
 # 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 UpdateUser(AWSQueryRequest):
-
-    ServiceClass = euca2ools.commands.euare.Euare
 
-    Description = """UpdateUser"""
-    Params = [Param(
-        name='UserName',
-        short_name='u',
-        long_name='user-name',
-        ptype='string',
-        optional=False,
-        doc=""" Name of the User to update.  If you're changing the name of the User, this is the original User name. """
-            ,
-        ), Param(
-        name='NewPath',
-        short_name='p',
-        long_name='new-path',
-        ptype='string',
-        optional=True,
-        doc=""" New path for the User. Include this parameter only if you're changing the User's path. """ ,
-        ), Param(
-        name='NewUserName',
-        short_name='n',
-        long_name='new-user-name',
-        ptype='string',
-        optional=True,
-        doc=""" New name for the User. Include this parameter only if you're changing the User's name. """ ,
-        ), Param(
-        name='Enabled',
-        short_name=None,
-        long_name='enabled',
-        ptype='string',
-        optional=True,
-        doc=""" [Eucalyptus extension] 'true' if to set user to be enabled. Otherwise 'false'. """ ,
-        ), Param(
-        name='RegStatus',
-        short_name=None,
-        long_name='reg-status',
-        ptype='string',
-        optional=True,
-        doc=""" [Eucalyptus extension] New registration status for user. Pick one from REGISTERED, APPROVED or CONFIRMED (use any case combination as you want). Only CONFIRMED user is valid to access the system. """ ,
-        ), Param(
-        name='PasswordExpiration',
-        short_name=None,
-        long_name='pwd-expires',
-        ptype='string',
-        optional=True,
-        doc=""" [Eucalyptus extension] New password expiration date. Use ISO8601 format. """ ,
-        ), 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):
-        pass
-    
-    def main(self, **args):
-        return self.send(**args)
 
-    def main_cli(self):
-        euca2ools.utils.print_version_if_necessary()
-        self.do_cli()
+class UpdateUser(EuareRequest):
+    DESCRIPTION = 'Change the name and/or path of a user'
+    ARGS = [Arg('-u', '--user-name', dest='UserName', metavar='USER',
+                required=True, help='name of the user to update'),
+            Arg('-n', '--new-user-name', dest='NewUserName', metavar='USER',
+                help='new name for the user'),
+            Arg('-p', '--new-path', dest='NewPath', metavar='PATH',
+                help='new path for the user'),
+            Arg('--enabled', dest='Enabled', choices=('true', 'false'),
+                help='''[Eucalyptus only] 'true' to enable the user, or 'false'
+                        to disable the user'''),
+            Arg('--reg-status', dest='RegStatus',
+                choices=('REGISTERED', 'APPROVED', 'CONFIRMED'),
+                help='''[Eucalyptus only] new registration status. Only
+                        CONFIRMED users may access the system.'''),
+            Arg('--pwd-expires', dest='PasswordExpiration', metavar='DATETIME',
+                help='''[Eucalyptus only] New password expiration date, in
+                        ISO8601 format'''),
+            DELEGATE]

-- 
managing cloud instances for Eucalyptus



More information about the pkg-eucalyptus-commits mailing list