make gluster volume name configurable
changed code to look at configuration file for the metadata gluster volume name. The default is still gsmetadata Change-Id: I9bf74b9566ea1c9716c42f7ced0f999e02824868 Signed-off-by: Thiago da Silva <thiago@redhat.com> Reviewed-on: http://review.gluster.org/6225 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
This commit is contained in:
parent
2bd930bb44
commit
a5c772955f
@ -92,7 +92,10 @@ class Swauth(object):
|
|||||||
pass
|
pass
|
||||||
raise ValueError(msg)
|
raise ValueError(msg)
|
||||||
self.swauth_remote_timeout = int(conf.get('swauth_remote_timeout', 10))
|
self.swauth_remote_timeout = int(conf.get('swauth_remote_timeout', 10))
|
||||||
self.auth_account = '%sgsmetadata' % self.reseller_prefix
|
|
||||||
|
self.metadata_volume = conf.get('metadata_volume', 'gsmetadata')
|
||||||
|
self.auth_account = '%s%s' % (self.reseller_prefix,
|
||||||
|
self.metadata_volume)
|
||||||
self.default_swift_cluster = conf.get(
|
self.default_swift_cluster = conf.get(
|
||||||
'default_swift_cluster',
|
'default_swift_cluster',
|
||||||
'local#http://127.0.0.1:8080/v1')
|
'local#http://127.0.0.1:8080/v1')
|
||||||
|
@ -64,6 +64,7 @@ user_test_tester3 = testing3
|
|||||||
use = egg:gluster_swift#swauth
|
use = egg:gluster_swift#swauth
|
||||||
set log_name = swauth
|
set log_name = swauth
|
||||||
super_admin_key = swauthkey
|
super_admin_key = swauthkey
|
||||||
|
metadata_volume = gsmetadata
|
||||||
|
|
||||||
[filter:cache]
|
[filter:cache]
|
||||||
use = egg:swift#memcache
|
use = egg:swift#memcache
|
||||||
|
@ -194,6 +194,20 @@ class TestAuth(unittest.TestCase):
|
|||||||
'Invalid auth_type in config file: %s' %
|
'Invalid auth_type in config file: %s' %
|
||||||
'Nonexistant')
|
'Nonexistant')
|
||||||
|
|
||||||
|
def test_default_metadata_volume_init(self):
|
||||||
|
app = FakeApp()
|
||||||
|
ath = auth.filter_factory({})(app)
|
||||||
|
self.assertEquals(ath.metadata_volume, 'gsmetadata')
|
||||||
|
|
||||||
|
def test_conf_metadata_volume_init(self):
|
||||||
|
app = FakeApp()
|
||||||
|
ath = auth.filter_factory(
|
||||||
|
{'metadata_volume': 'meta_test'})(app)
|
||||||
|
self.assertEquals(ath.metadata_volume, 'meta_test')
|
||||||
|
ath = auth.filter_factory(
|
||||||
|
{'metadata_volume': 'new_meta_volume'})(app)
|
||||||
|
self.assertEquals(ath.metadata_volume, 'new_meta_volume')
|
||||||
|
|
||||||
def test_default_swift_cluster_init(self):
|
def test_default_swift_cluster_init(self):
|
||||||
app = FakeApp()
|
app = FakeApp()
|
||||||
self.assertRaises(Exception, auth.filter_factory({
|
self.assertRaises(Exception, auth.filter_factory({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user