Skip to content

Commit

Permalink
configurators: extend ConfiguratorBase to include more common fields …
Browse files Browse the repository at this point in the history
…and dry up the code
  • Loading branch information
Mic92 committed Nov 9, 2023
1 parent 09a54ab commit 5285b2d
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions master/buildbot/configurators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,9 @@ def __init__(self):

def configure(self, config_dict):
self.config_dict = c = config_dict
if 'schedulers' not in c:
c['schedulers'] = []
self.schedulers = c['schedulers']
if 'protocols' not in c:
c['protocols'] = {}
self.protocols = c['protocols']
if 'builders' not in c:
c['builders'] = []
self.builders = c['builders']
if 'workers' not in c:
c['workers'] = []
self.workers = c['workers']
fields = ['schedulers', 'protocols', 'builders', 'workers', 'projects', 'secretProviders']
for k in fields:
c.setdefault(k, [])
setattr(self, k, c[k])
c.setdefault('www', {})
c.www = c['www']

0 comments on commit 5285b2d

Please sign in to comment.