mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-25 03:47:22 +00:00
Refactor config file reading.
This commit is contained in:
parent
7a98a496e4
commit
367fd3981a
1 changed files with 8 additions and 3 deletions
|
@ -84,6 +84,13 @@ def nuke_prefixed_buckets():
|
||||||
|
|
||||||
print 'Done with cleanup of test buckets.'
|
print 'Done with cleanup of test buckets.'
|
||||||
|
|
||||||
|
def read_config(fp):
|
||||||
|
config = bunch.Bunch()
|
||||||
|
g = yaml.safe_load_all(fp)
|
||||||
|
for new in g:
|
||||||
|
config.update(bunch.bunchify(new))
|
||||||
|
return config
|
||||||
|
|
||||||
def setup():
|
def setup():
|
||||||
global s3, config, prefix
|
global s3, config, prefix
|
||||||
s3.clear()
|
s3.clear()
|
||||||
|
@ -97,9 +104,7 @@ def setup():
|
||||||
+ 'variable S3TEST_CONF to a config file.',
|
+ 'variable S3TEST_CONF to a config file.',
|
||||||
)
|
)
|
||||||
with file(path) as f:
|
with file(path) as f:
|
||||||
g = yaml.safe_load_all(f)
|
config.update(read_config(f))
|
||||||
for new in g:
|
|
||||||
config.update(bunch.bunchify(new))
|
|
||||||
|
|
||||||
# These 3 should always be present.
|
# These 3 should always be present.
|
||||||
if 's3' not in config:
|
if 's3' not in config:
|
||||||
|
|
Loading…
Reference in a new issue