From caa8818eee7a3224c7d2c4fc14d5110e7b41df39 Mon Sep 17 00:00:00 2001 From: Thiago da Silva Date: Tue, 3 Dec 2013 18:42:23 -0500 Subject: [PATCH] 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 Reviewed-on: http://review.gluster.org/6417 Reviewed-by: pushpesh sharma Tested-by: pushpesh sharma Reviewed-by: Shilpa MJ Tested-by: Shilpa MJ Reviewed-by: Luis Pabon --- ...{swauth-add-account => gswauth-add-account} | 4 ++-- .../bin/{swauth-add-user => gswauth-add-user} | 4 ++-- ...h-cleanup-tokens => gswauth-cleanup-tokens} | 4 ++-- ...h-delete-account => gswauth-delete-account} | 2 +- ...{swauth-delete-user => gswauth-delete-user} | 2 +- .../gswauth/bin/{swauth-list => gswauth-list} | 2 +- .../gswauth/bin/{swauth-prep => gswauth-prep} | 2 +- ...unt-service => gswauth-set-account-service} | 4 ++-- glusterfs-openstack-swift.spec | 16 ++++++++-------- setup.py | 16 ++++++++-------- .../gswauth/test_gswauth_cli.py | 18 +++++++++--------- tools/gswauth_functional_tests.sh | 10 +++++----- tools/tox_run.sh | 9 ++++----- 13 files changed, 46 insertions(+), 47 deletions(-) rename gluster/swift/common/middleware/gswauth/bin/{swauth-add-account => gswauth-add-account} (97%) rename gluster/swift/common/middleware/gswauth/bin/{swauth-add-user => gswauth-add-user} (98%) rename gluster/swift/common/middleware/gswauth/bin/{swauth-cleanup-tokens => gswauth-cleanup-tokens} (98%) rename gluster/swift/common/middleware/gswauth/bin/{swauth-delete-account => gswauth-delete-account} (98%) rename gluster/swift/common/middleware/gswauth/bin/{swauth-delete-user => gswauth-delete-user} (98%) rename gluster/swift/common/middleware/gswauth/bin/{swauth-list => gswauth-list} (98%) rename gluster/swift/common/middleware/gswauth/bin/{swauth-prep => gswauth-prep} (98%) rename gluster/swift/common/middleware/gswauth/bin/{swauth-set-account-service => gswauth-set-account-service} (94%) diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-add-account b/gluster/swift/common/middleware/gswauth/bin/gswauth-add-account similarity index 97% rename from gluster/swift/common/middleware/gswauth/bin/swauth-add-account rename to gluster/swift/common/middleware/gswauth/bin/gswauth-add-account index 88f8010..9ac5919 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-add-account +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-add-account @@ -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] ') parser.add_option('-s', '--suffix', dest='suffix', default='', help='The suffix to use with the reseller prefix as the ' 'storage account name (default: ) 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/)') diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-add-user b/gluster/swift/common/middleware/gswauth/bin/gswauth-add-user similarity index 98% rename from gluster/swift/common/middleware/gswauth/bin/swauth-add-user rename to gluster/swift/common/middleware/gswauth/bin/gswauth-add-user index 81eeac7..0b57f6f 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-add-user +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-add-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', dest='admin', action='store_true', @@ -41,7 +41,7 @@ if __name__ == '__main__': 'storage account name (default: ) 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/') diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-cleanup-tokens b/gluster/swift/common/middleware/gswauth/bin/gswauth-cleanup-tokens similarity index 98% rename from gluster/swift/common/middleware/gswauth/bin/swauth-cleanup-tokens rename to gluster/swift/common/middleware/gswauth/bin/gswauth-cleanup-tokens index 54bed9d..a295b13 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-cleanup-tokens +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-cleanup-tokens @@ -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 ' diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-delete-account b/gluster/swift/common/middleware/gswauth/bin/gswauth-delete-account similarity index 98% rename from gluster/swift/common/middleware/gswauth/bin/swauth-delete-account rename to gluster/swift/common/middleware/gswauth/bin/gswauth-delete-account index 224e3b3..854a5d4 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-delete-account +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-delete-account @@ -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 ' diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-delete-user b/gluster/swift/common/middleware/gswauth/bin/gswauth-delete-user similarity index 98% rename from gluster/swift/common/middleware/gswauth/bin/swauth-delete-user rename to gluster/swift/common/middleware/gswauth/bin/gswauth-delete-user index 3991d9a..a56dea1 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-delete-user +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-delete-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 ' diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-list b/gluster/swift/common/middleware/gswauth/bin/gswauth-list similarity index 98% rename from gluster/swift/common/middleware/gswauth/bin/swauth-list rename to gluster/swift/common/middleware/gswauth/bin/gswauth-list index 7ad0974..7a38f77 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-list +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-list @@ -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] diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-prep b/gluster/swift/common/middleware/gswauth/bin/gswauth-prep similarity index 98% rename from gluster/swift/common/middleware/gswauth/bin/swauth-prep rename to gluster/swift/common/middleware/gswauth/bin/gswauth-prep index bf2384f..cfe75af 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-prep +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-prep @@ -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 ' diff --git a/gluster/swift/common/middleware/gswauth/bin/swauth-set-account-service b/gluster/swift/common/middleware/gswauth/bin/gswauth-set-account-service similarity index 94% rename from gluster/swift/common/middleware/gswauth/bin/swauth-set-account-service rename to gluster/swift/common/middleware/gswauth/bin/gswauth-set-account-service index b0bed38..1b5c354 100755 --- a/gluster/swift/common/middleware/gswauth/bin/swauth-set-account-service +++ b/gluster/swift/common/middleware/gswauth/bin/gswauth-set-account-service @@ -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] 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 ' diff --git a/glusterfs-openstack-swift.spec b/glusterfs-openstack-swift.spec index 357f682..bca64c3 100644 --- a/glusterfs-openstack-swift.spec +++ b/glusterfs-openstack-swift.spec @@ -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} diff --git a/setup.py b/setup.py index 82b2a76..a70cd29 100644 --- a/setup.py +++ b/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={ diff --git a/test/functional_auth/gswauth/test_gswauth_cli.py b/test/functional_auth/gswauth/test_gswauth_cli.py index f6c08df..e63eeb2 100644 --- a/test/functional_auth/gswauth/test_gswauth_cli.py +++ b/test/functional_auth/gswauth/test_gswauth_cli.py @@ -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) diff --git a/tools/gswauth_functional_tests.sh b/tools/gswauth_functional_tests.sh index 0c09fa2..5e4b31a 100755 --- a/tools/gswauth_functional_tests.sh +++ b/tools/gswauth_functional_tests.sh @@ -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 \ diff --git a/tools/tox_run.sh b/tools/tox_run.sh index da10630..0499690 100755 --- a/tools/tox_run.sh +++ b/tools/tox_run.sh @@ -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