diff options
Diffstat (limited to 'lorry-controller-webapp')
-rwxr-xr-x | lorry-controller-webapp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lorry-controller-webapp b/lorry-controller-webapp index 9e3a310..6fc827e 100755 --- a/lorry-controller-webapp +++ b/lorry-controller-webapp @@ -131,17 +131,21 @@ class WEBAPP(cliapp.Application): self.settings.choice( ['downstream-host-type', 'git-server-type'], - ['gitano', 'gerrit', 'gitlab', 'local'], + # Default is the first choice, and must be 'gitano' for backward + # compatibility + ['gitano'] + + sorted(host_type + for host_type in lorrycontroller.downstream_types.keys() + if host_type != 'gitano'), 'what API the Downstream Host speaks') - self.settings.string( - ['gitlab-private-token'], - 'private token for GitLab API access') - self.settings.boolean( ['publish-failures'], 'make the status page show failure logs from lorry') + for downstream_type in lorrycontroller.downstream_types.values(): + downstream_type.add_app_settings(self.settings) + def find_routes(self): '''Return all classes that are API routes. @@ -166,11 +170,8 @@ class WEBAPP(cliapp.Application): def process_args(self, args): self.settings.require('statedb') - if (self.settings['git-server-type'] == 'gitlab' and - not self.settings['gitlab-private-token']): - logging.error('A private token must be provided to create ' - 'repositories on a GitLab instance.') - self.settings.require('gitlab-private-token') + lorrycontroller.downstream_types[self.settings['git-server-type']] \ + .check_app_settings(self.settings) self.setup_proxy() |