diff options
Diffstat (limited to 'lorrycontroller/readconf.py')
-rw-r--r-- | lorrycontroller/readconf.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lorrycontroller/readconf.py b/lorrycontroller/readconf.py index 5323a3f..aee2462 100644 --- a/lorrycontroller/readconf.py +++ b/lorrycontroller/readconf.py @@ -71,7 +71,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute): lorries_to_remove = lorries_to_remove.difference(added) elif section['type'] in ('trove', 'troves', 'gitlab'): self.add_trove(statedb, section) - trovehost = section['trovehost'] + trovehost = section.get('host') or section['trovehost'] if trovehost in troves_to_remove: troves_to_remove.remove(trovehost) lorries_to_remove = lorries_to_remove.difference( @@ -291,7 +291,7 @@ class ReadConfiguration(lorrycontroller.LorryControllerRoute): gitlab_token = section['private-token'] statedb.add_trove( - trovehost=section['trovehost'], + trovehost=section.get('host') or section['trovehost'], protocol=section['protocol'], username=username, password=password, @@ -351,9 +351,11 @@ class LorryControllerConfValidator(object): self._check_has_required_fields(section, ['private-token']) def _check_troves_section(self, section): + if not any(i in ('trovehost', 'host') for i in section): + self._check_has_required_fields(section, ['host']) self._check_has_required_fields( section, - ['trovehost', 'protocol', 'interval', 'ls-interval', 'prefixmap']) + ['protocol', 'interval', 'ls-interval', 'prefixmap']) self._check_protocol(section) self._check_prefixmap(section) if 'ignore' in section: |