diff options
author | Thiago da Silva <thiago@redhat.com> | 2013-12-03 18:42:23 -0500 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2013-12-06 07:44:08 -0800 |
commit | caa8818eee7a3224c7d2c4fc14d5110e7b41df39 (patch) | |
tree | d577db5a08577c098f406816cc20b0a14cb0991c /gluster/swift/common/middleware/gswauth/bin/swauth-delete-user | |
parent | 3fcbe6c2d1543fab1c9ced8a43d07994494d6f46 (diff) |
renaming swauth tools to gswauth
cli tools for account and user mgmt have been renamed
from swauth-* to gswauth-*
Updated other configuration and test files accordingly
Change-Id: Iced3bb27fbd09da45754ddb264f8fb4528ab423c
Signed-off-by: Thiago da Silva <thiago@redhat.com>
Reviewed-on: http://review.gluster.org/6417
Reviewed-by: pushpesh sharma <psharma@redhat.com>
Tested-by: pushpesh sharma <psharma@redhat.com>
Reviewed-by: Shilpa MJ <smanjara@redhat.com>
Tested-by: Shilpa MJ <smanjara@redhat.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'gluster/swift/common/middleware/gswauth/bin/swauth-delete-user')
-rwxr-xr-x | gluster/swift/common/middleware/gswauth/bin/swauth-delete-user | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-delete-user b/gluster/swift/common/middleware/gswauth/bin/swauth-delete-user deleted file mode 100755 index 3991d9a..0000000 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-delete-user +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2010-2011 OpenStack, LLC. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -# implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import gettext -from optparse import OptionParser -from os.path import basename -from sys import argv, exit - -from swift.common.bufferedhttp import http_connect_raw as http_connect -from swift.common.utils import urlparse - - -if __name__ == '__main__': - gettext.install('swauth', unicode=1) - parser = OptionParser(usage='Usage: %prog [options] <account> <user>') - parser.add_option('-A', '--admin-url', dest='admin_url', - 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).') - parser.add_option('-K', '--admin-key', dest='admin_key', - help='The key for the user with admin rights to add users.') - args = argv[1:] - if not args: - args.append('-h') - (options, args) = parser.parse_args(args) - if len(args) != 2: - parser.parse_args(['-h']) - account, user = args - parsed = urlparse(options.admin_url) - if parsed.scheme not in ('http', 'https'): - raise Exception('Cannot handle protocol scheme %s for url %s' % - (parsed.scheme, repr(options.admin_url))) - parsed_path = parsed.path - if not parsed_path: - parsed_path = '/' - elif parsed_path[-1] != '/': - parsed_path += '/' - path = '%sv2/%s/%s' % (parsed_path, account, user) - headers = {'X-Auth-Admin-User': options.admin_user, - 'X-Auth-Admin-Key': options.admin_key} - conn = http_connect(parsed.hostname, parsed.port, 'DELETE', path, headers, - ssl=(parsed.scheme == 'https')) - resp = conn.getresponse() - if resp.status // 100 != 2: - exit('User deletion failed: %s %s' % (resp.status, resp.reason)) |