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>
This commit is contained in:
parent
3fcbe6c2d1
commit
caa8818eee
@ -24,14 +24,14 @@ from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', unicode=1)
|
||||
parser = OptionParser(usage='Usage: %prog [options] <account>')
|
||||
parser.add_option('-s', '--suffix', dest='suffix',
|
||||
default='', help='The suffix to use with the reseller prefix as the '
|
||||
'storage account name (default: <randomly-generated-uuid4>) Note: If '
|
||||
'the account already exists, this will have no effect on existing '
|
||||
'service URLs. Those will need to be updated with '
|
||||
'swauth-set-account-service')
|
||||
'gswauth-set-account-service')
|
||||
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/)')
|
@ -24,7 +24,7 @@ from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', unicode=1)
|
||||
parser = OptionParser(
|
||||
usage='Usage: %prog [options] <account> <user> <password>')
|
||||
parser.add_option('-a', '--admin', dest='admin', action='store_true',
|
||||
@ -41,7 +41,7 @@ if __name__ == '__main__':
|
||||
'storage account name (default: <randomly-generated-uuid4>) Note: If '
|
||||
'the account already exists, this will have no effect on existing '
|
||||
'service URLs. Those will need to be updated with '
|
||||
'swauth-set-account-service')
|
||||
'gswauth-set-account-service')
|
||||
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/')
|
@ -28,7 +28,7 @@ from time import sleep, time
|
||||
from swiftclient.client import Connection, ClientException
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', unicode=1)
|
||||
parser = OptionParser(usage='Usage: %prog [options]')
|
||||
parser.add_option('-t', '--token-life', dest='token_life',
|
||||
default='86400', help='The expected life of tokens; token objects '
|
||||
@ -105,7 +105,7 @@ if __name__ == '__main__':
|
||||
objs = conn.get_container(container, marker=marker)[1]
|
||||
except ClientException, e:
|
||||
if e.http_status == 404:
|
||||
exit('Container %s not found. swauth-prep needs to be '
|
||||
exit('Container %s not found. gswauth-prep needs to be '
|
||||
'rerun' % (container))
|
||||
else:
|
||||
exit('Object listing on container %s failed with status '
|
@ -24,7 +24,7 @@ from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', unicode=1)
|
||||
parser = OptionParser(usage='Usage: %prog [options] <account>')
|
||||
parser.add_option('-A', '--admin-url', dest='admin_url',
|
||||
default='http://127.0.0.1:8080/auth/', help='The URL to the auth '
|
@ -24,7 +24,7 @@ from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', 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 '
|
@ -29,7 +29,7 @@ from swift.common.utils import urlparse
|
||||
from prettytable import PrettyTable
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', unicode=1)
|
||||
parser = OptionParser(usage='''
|
||||
Usage: %prog [options] [account] [user]
|
||||
|
@ -24,7 +24,7 @@ from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', unicode=1)
|
||||
parser = OptionParser(usage='Usage: %prog [options]')
|
||||
parser.add_option('-A', '--admin-url', dest='admin_url',
|
||||
default='http://127.0.0.1:8080/auth/', help='The URL to the auth '
|
@ -28,13 +28,13 @@ from swift.common.utils import urlparse
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
gettext.install('swauth', unicode=1)
|
||||
gettext.install('gswauth', unicode=1)
|
||||
parser = OptionParser(usage='''
|
||||
Usage: %prog [options] <account> <service> <name> <value>
|
||||
|
||||
Sets a service URL for an account. Can only be set by a reseller admin.
|
||||
|
||||
Example: %prog -K swauthkey test storage local http://127.0.0.1:8080/v1/AUTH_018c3946-23f8-4efb-a8fb-b67aae8e4162
|
||||
Example: %prog -K gswauthkey test storage local http://127.0.0.1:8080/v1/AUTH_018c3946-23f8-4efb-a8fb-b67aae8e4162
|
||||
'''.strip())
|
||||
parser.add_option('-A', '--admin-url', dest='admin_url',
|
||||
default='http://127.0.0.1:8080/auth/', help='The URL to the auth '
|
@ -77,14 +77,14 @@ done
|
||||
%{python_sitelib}/gluster_swift-%{_version}_*.egg-info
|
||||
%{_bindir}/gluster-swift-gen-builders
|
||||
%{_bindir}/gluster-swift-print-metadata
|
||||
%{_bindir}/swauth-add-account
|
||||
%{_bindir}/swauth-add-user
|
||||
%{_bindir}/swauth-cleanup-tokens
|
||||
%{_bindir}/swauth-delete-account
|
||||
%{_bindir}/swauth-delete-user
|
||||
%{_bindir}/swauth-list
|
||||
%{_bindir}/swauth-prep
|
||||
%{_bindir}/swauth-set-account-service
|
||||
%{_bindir}/gswauth-add-account
|
||||
%{_bindir}/gswauth-add-user
|
||||
%{_bindir}/gswauth-cleanup-tokens
|
||||
%{_bindir}/gswauth-delete-account
|
||||
%{_bindir}/gswauth-delete-user
|
||||
%{_bindir}/gswauth-list
|
||||
%{_bindir}/gswauth-prep
|
||||
%{_bindir}/gswauth-set-account-service
|
||||
%{_mandir}/man8/*
|
||||
|
||||
%dir %{_confdir}
|
||||
|
16
setup.py
16
setup.py
@ -44,15 +44,15 @@ setup(
|
||||
scripts=[
|
||||
'bin/gluster-swift-gen-builders',
|
||||
'bin/gluster-swift-print-metadata',
|
||||
'gluster/swift/common/middleware/gswauth/bin/swauth-add-account',
|
||||
'gluster/swift/common/middleware/gswauth/bin/swauth-add-user',
|
||||
'gluster/swift/common/middleware/gswauth/bin/swauth-cleanup-tokens',
|
||||
'gluster/swift/common/middleware/gswauth/bin/swauth-delete-account',
|
||||
'gluster/swift/common/middleware/gswauth/bin/swauth-delete-user',
|
||||
'gluster/swift/common/middleware/gswauth/bin/swauth-list',
|
||||
'gluster/swift/common/middleware/gswauth/bin/swauth-prep',
|
||||
'gluster/swift/common/middleware/gswauth/bin/gswauth-add-account',
|
||||
'gluster/swift/common/middleware/gswauth/bin/gswauth-add-user',
|
||||
'gluster/swift/common/middleware/gswauth/bin/gswauth-cleanup-tokens',
|
||||
'gluster/swift/common/middleware/gswauth/bin/gswauth-delete-account',
|
||||
'gluster/swift/common/middleware/gswauth/bin/gswauth-delete-user',
|
||||
'gluster/swift/common/middleware/gswauth/bin/gswauth-list',
|
||||
'gluster/swift/common/middleware/gswauth/bin/gswauth-prep',
|
||||
'gluster/swift/common/middleware/gswauth/bin/'
|
||||
'swauth-set-account-service',
|
||||
'gswauth-set-account-service',
|
||||
|
||||
],
|
||||
entry_points={
|
||||
|
@ -27,35 +27,35 @@ class Utils:
|
||||
|
||||
@classmethod
|
||||
def addAccount(self,account_name,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-add-account %s -A %s -U %s -K %s' % (account_name,authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-add-account %s -A %s -U %s -K %s' % (account_name,authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def deleteAccount(self,account_name,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-delete-account %s -A %s -U %s -K %s' % (account_name,authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-delete-account %s -A %s -U %s -K %s' % (account_name,authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def listAccounts(self,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-list -A %s -U %s -K %s' % (authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-list -A %s -U %s -K %s' % (authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def swauthPrep(self,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-prep -A %s -U %s -K %s' % (authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-prep -A %s -U %s -K %s' % (authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def addAdminUser(self,account_name,username,password,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-add-user -a %s %s %s -A %s -U %s -K %s'% (account_name,username,password,authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-add-user -a %s %s %s -A %s -U %s -K %s'% (account_name,username,password,authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def addUser(self,account_name,username,password,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-add-user %s %s %s -A %s -U %s -K %s'% (account_name,username,password,authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-add-user %s %s %s -A %s -U %s -K %s'% (account_name,username,password,authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def addResellerAdminUser(self,account_name,username,password,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-add-user -r %s %s %s -A %s -U %s -K %s'% (account_name, username, password, authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-add-user -r %s %s %s -A %s -U %s -K %s'% (account_name, username, password, authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def deleteUser(self,account_name,username,authurl='http://127.0.0.1:8080/auth/',user=config['admin_user'],key=config['admin_key']):
|
||||
return commands.getstatusoutput('swauth-delete-user %s %s -A %s -U %s -K %s'% (account_name, username, authurl, user, key))
|
||||
return commands.getstatusoutput('gswauth-delete-user %s %s -A %s -U %s -K %s'% (account_name, username, authurl, user, key))
|
||||
|
||||
@classmethod
|
||||
def cleanAll(self):
|
||||
@ -74,7 +74,7 @@ class TestSwauthPrep(unittest.TestCase):
|
||||
|
||||
def testSwauthPrep(self):
|
||||
(status,output)=Utils.swauthPrep()
|
||||
self.assertEqual(status, 0, 'swuath prep failed with valid credentials'+output)
|
||||
self.assertEqual(status, 0, 'swauth prep failed with valid credentials'+output)
|
||||
|
||||
(status,output)=Utils.swauthPrep(key='')
|
||||
self.assertEqual('Usage' in output,True, 'Invalid swauth-prep request accepted(no key provided): '+output)
|
||||
|
@ -59,10 +59,10 @@ run_generic_tests()
|
||||
gswauth_cleanup
|
||||
|
||||
#swauth-prep
|
||||
sudo_env swauth-prep -K gswauthkey || fail "Unable to prep gswauth"
|
||||
sudo_env swauth-add-user -K gswauthkey -a test tester testing || fail "Unable to add user test"
|
||||
sudo_env swauth-add-user -K gswauthkey -a test2 tester2 testing2 || fail "Unable to add user test2"
|
||||
sudo_env swauth-add-user -K gswauthkey test tester3 testing3 || fail "Unable to add user test3"
|
||||
sudo_env gswauth-prep -K gswauthkey || fail "Unable to prep gswauth"
|
||||
sudo_env gswauth-add-user -K gswauthkey -a test tester testing || fail "Unable to add user test"
|
||||
sudo_env gswauth-add-user -K gswauthkey -a test2 tester2 testing2 || fail "Unable to add user test2"
|
||||
sudo_env gswauth-add-user -K gswauthkey test tester3 testing3 || fail "Unable to add user test3"
|
||||
|
||||
nosetests -v --exe \
|
||||
--with-xunit \
|
||||
@ -105,7 +105,7 @@ sudo service memcached start || fail "Unable to start memcached"
|
||||
sudo_env swift-init main start || fail "Unable to start swift"
|
||||
|
||||
#swauth-prep
|
||||
sudo_env swauth-prep -K gswauthkey || fail "Unable to prep gswauth"
|
||||
sudo_env gswauth-prep -K gswauthkey || fail "Unable to prep gswauth"
|
||||
|
||||
mkdir functional_tests > /dev/null 2>&1
|
||||
nosetests -v --exe \
|
||||
|
@ -80,11 +80,10 @@ sudo service memcached start || fail "Unable to start memcached"
|
||||
sudo_env swift-init main start || fail "Unable to start swift"
|
||||
|
||||
#swauth-prep
|
||||
sudo_env swauth-prep -K gswauthkey || fail "Unable to prep gswauth"
|
||||
sudo_env swauth-prep -K gswauthkey || fail "Unable to prep gswauth"
|
||||
sudo_env swauth-add-user -K gswauthkey -a test tester testing || fail "Unable to add user test"
|
||||
sudo_env swauth-add-user -K gswauthkey -a test2 tester2 testing2 || fail "Unable to add user test2"
|
||||
sudo_env swauth-add-user -K gswauthkey test tester3 testing3 || fail "Unable to add user test3"
|
||||
sudo_env gswauth-prep -K gswauthkey || fail "Unable to prep gswauth"
|
||||
sudo_env gswauth-add-user -K gswauthkey -a test tester testing || fail "Unable to add user test"
|
||||
sudo_env gswauth-add-user -K gswauthkey -a test2 tester2 testing2 || fail "Unable to add user test2"
|
||||
sudo_env gswauth-add-user -K gswauthkey test tester3 testing3 || fail "Unable to add user test3"
|
||||
|
||||
# open the shell to the user
|
||||
bash --norc -i
|
||||
|
Loading…
Reference in New Issue
Block a user