utilize multiple volume support

This commit is contained in:
Tomas Kopecek 2017-03-28 14:41:42 +02:00 committed by Mike McLean
parent 08beabe847
commit af8038fa12
2 changed files with 7 additions and 1 deletions

View file

@ -1,2 +1,5 @@
[global]
volume = DEFAULT
[filters]
paths = */tmp/krb5cc:*/etc/*.keytab

View file

@ -22,9 +22,12 @@ def read_config():
cp.read(CONFIG_FILE)
config = {
'path_filters': [],
'volume': None,
}
if cp.has_option('filters', 'paths'):
config['path_filters'] = cp.get('filters', 'paths').split(':')
if cp.has_option('general', 'volume'):
config['volume'] = cp.get('general', 'volume').strip()
class SaveFailedTreeTask(tasks.BaseTaskHandler):
Methods = ['saveFailedTree']
@ -46,6 +49,6 @@ class SaveFailedTreeTask(tasks.BaseTaskHandler):
f.add(path, filter=omit_paths)
f.close()
self.logger.debug("Uploading %s to hub." % tar_path)
self.uploadFile(tar_path)
self.uploadFile(tar_path, volume=config['volume'])
os.unlink(tar_path)
self.logger.debug("Finished saving buildroots for task %d" % taskID)