Remove layout.projects

The layout object doesn't keep track of Project objects anymore,
instead, they originate in pipeline sources.  However, the layout
does have ProjectConfig objects, which are similar, in that they
let us get a list of project names that the layout knows about.

Change-Id: Ib757b7cdff5d7e54a70db60821212ac616b53275
This commit is contained in:
James E. Blair 2017-02-02 10:03:30 -08:00
parent 21c200e601
commit ae76ac558e
3 changed files with 15 additions and 14 deletions

View File

@ -76,12 +76,12 @@ class TimerDriver(Driver, TriggerInterface):
jobs.append(job)
def _onTrigger(self, tenant, pipeline_name, timespec):
for project in tenant.layout.projects.values():
for project_name in tenant.layout.project_configs.keys():
event = TriggerEvent()
event.type = 'timer'
event.timespec = timespec
event.forced_pipeline = pipeline_name
event.project_name = project.name
event.project_name = project_name
self.log.debug("Adding event %s" % event)
self.sched.addEvent(event)

View File

@ -67,15 +67,16 @@ class PipelineManager(object):
def log_jobs(tree, indent=0):
istr = ' ' + ' ' * indent
if tree.job:
# TODOv3(jeblair): represent matchers
efilters = ''
for b in tree.job._branches:
efilters += str(b)
for f in tree.job._files:
efilters += str(f)
if tree.job.skip_if_matcher:
efilters += str(tree.job.skip_if_matcher)
if efilters:
efilters = ' ' + efilters
# for b in tree.job._branches:
# efilters += str(b)
# for f in tree.job._files:
# efilters += str(f)
# if tree.job.skip_if_matcher:
# efilters += str(tree.job.skip_if_matcher)
# if efilters:
# efilters = ' ' + efilters
tags = []
if tree.job.hold_following_changes:
tags.append('[hold]')
@ -89,10 +90,11 @@ class PipelineManager(object):
for x in tree.job_trees:
log_jobs(x, indent + 2)
for p in layout.projects.values():
tree = self.pipeline.getJobTree(p)
for project_name in layout.project_configs.keys():
project = self.pipeline.source.getProject(project_name)
tree = self.pipeline.getJobTree(project)
if tree:
self.log.info(" %s" % p)
self.log.info(" %s" % project)
log_jobs(tree)
self.log.info(" On start:")
self.log.info(" %s" % self.pipeline.start_actions)

View File

@ -1827,7 +1827,6 @@ class Layout(object):
def __init__(self):
self.tenant = None
self.projects = {}
self.project_configs = {}
self.project_templates = {}
self.pipelines = OrderedDict()