Browse Source

Use an OrderedDict for pipelines

So that status displays will show pipelines in the order defined
in the config file.

Change-Id: I2913c94dd44f4443f5bdca54241fd1af027258a8
changes/22/43922/3
James E. Blair 9 years ago
parent
commit
5a9918ae4b
  1. 1
      requirements.txt
  2. 6
      zuul/model.py
  3. 2
      zuul/scheduler.py

1
requirements.txt

@ -9,6 +9,7 @@ WebOb
paramiko
GitPython>=0.3.2.RC1
lockfile
ordereddict
python-daemon
extras
statsd>=1.0.0,<3.0

6
zuul/model.py

@ -15,6 +15,10 @@
import re
import time
from uuid import uuid4
import extras
OrderedDict = extras.try_imports(['collections.OrderedDict',
'ordereddict.OrderedDict'])
MERGER_MERGE = 1 # "git merge"
@ -916,7 +920,7 @@ class EventFilter(object):
class Layout(object):
def __init__(self):
self.projects = {}
self.pipelines = {}
self.pipelines = OrderedDict()
self.jobs = {}
self.metajobs = []

2
zuul/scheduler.py

@ -600,7 +600,6 @@ class Scheduler(threading.Thread):
ret += '</p>'
keys = self.layout.pipelines.keys()
keys.sort()
for key in keys:
pipeline = self.layout.pipelines[key]
s = 'Pipeline: %s' % pipeline.name
@ -631,7 +630,6 @@ class Scheduler(threading.Thread):
pipelines = []
data['pipelines'] = pipelines
keys = self.layout.pipelines.keys()
keys.sort()
for key in keys:
pipeline = self.layout.pipelines[key]
pipelines.append(pipeline.formatStatusJSON())

Loading…
Cancel
Save