Update storage configuration reading

Related T613
This commit is contained in:
Antoine R. Dumont (@ardumont) 2016-12-15 19:07:02 +01:00
parent 9809deec00
commit b217f55cfe
No known key found for this signature in database
GPG key ID: 52E2E9840D10C3B8
3 changed files with 10 additions and 8 deletions

4
debian/control vendored
View file

@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 9),
python3-setuptools,
python3-swh.core,
python3-swh.scheduler (>= 0.0.10~),
python3-swh.storage (>= 0.0.69~),
python3-swh.storage (>= 0.0.76~),
python3-vcversioner
Standards-Version: 3.9.6
Homepage: https://forge.softwareheritage.org/diffusion/DLSGH/
@ -18,7 +18,7 @@ Homepage: https://forge.softwareheritage.org/diffusion/DLSGH/
Package: python3-swh.lister.github
Architecture: all
Depends: python3-swh.scheduler (>= 0.0.10~),
python3-swh.storage (>= 0.0.69~),
python3-swh.storage (>= 0.0.76~),
${misc:Depends},
${python3:Depends}
Description: Software Heritage GitHub lister

View file

@ -2,5 +2,5 @@ requests
SQLAlchemy
swh.core
swh.storage >= 0.0.69
swh.storage >= 0.0.76
swh.scheduler >= 0.0.10

View file

@ -13,9 +13,12 @@ class SWHLister(config.SWHConfig):
CONFIG_BASE_FILENAME = None
DEFAULT_CONFIG = {
'storage_class': ('str', 'remote_storage'),
'storage_args': ('list[str]', ['http://localhost:5000/']),
'storage': ('dict', {
'cls': 'remote',
'args': {
'url': 'http://localhost:5000/'
},
}),
'scheduling_db': ('str', 'dbname=softwareheritage-scheduler'),
}
@ -25,8 +28,7 @@ class SWHLister(config.SWHConfig):
self.config = self.parse_config_file(
additional_configs=[self.ADDITIONAL_CONFIG])
self.storage = get_storage(self.config['storage_class'],
self.config['storage_args'])
self.storage = get_storage(**self.config['storage'])
self.scheduler = SchedulerBackend(
scheduling_db=self.config['scheduling_db'],