From ac55cfb30b8600a105575783f26c1fe2048407af Mon Sep 17 00:00:00 2001 From: Thiago da Silva Date: Fri, 20 Dec 2013 13:23:35 -0500 Subject: fixed gswauth cmd tools to require admin key argument All tools were changed to display the usage help text in case the admin key is not provided as an argument Bug 1261677: https://bugs.launchpad.net/gluster-swift/+bug/1261677 Change-Id: I37fa8518be970364b81955644931f6e416bcdc42 Signed-off-by: Thiago da Silva Reviewed-on: http://review.gluster.org/6553 Reviewed-by: Prashanth Pai Tested-by: Prashanth Pai Reviewed-by: pushpesh sharma Tested-by: pushpesh sharma Reviewed-by: Luis Pabon --- gluster/swift/common/middleware/gswauth/bin/gswauth-list | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gluster/swift/common/middleware/gswauth/bin/gswauth-list') diff --git a/gluster/swift/common/middleware/gswauth/bin/gswauth-list b/gluster/swift/common/middleware/gswauth/bin/gswauth-list index 23175e9..4f2d834 100755 --- a/gluster/swift/common/middleware/gswauth/bin/gswauth-list +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-list @@ -55,16 +55,18 @@ If the [user] is '.groups', the active groups for the account will be listed. default='http://127.0.0.1:8080/auth/', help='The URL to the auth ' 'subsystem (default: http://127.0.0.1:8080/auth/') parser.add_option('-U', '--admin-user', dest='admin_user', - default='.super_admin', help='The user with admin rights to add users ' + default='.super_admin', help='The user with admin rights ' '(default: .super_admin).') parser.add_option('-K', '--admin-key', dest='admin_key', - help='The key for the user with admin rights to add users.') + help='The key for the user with admin rights is required.') args = argv[1:] if not args: args.append('-h') (options, args) = parser.parse_args(args) if len(args) > 2: parser.parse_args(['-h']) + if options.admin_key is None: + parser.parse_args(['-h']) parsed = urlparse(options.admin_url) if parsed.scheme not in ('http', 'https'): raise Exception('Cannot handle protocol scheme %s for url %s' % -- cgit