[yocto] [yocto-autobuilder][PATCH v1 3/4] master.py/botmaster.py: use builders list for builders order

stefan at agner.ch stefan at agner.ch
Thu May 8 09:44:27 PDT 2014


From: Stefan Agner <stefan at agner.ch>

This patch uses the order of the list builderNames when requesting
builder names. This order is relevant for the Waterfall order.

However, the order of builderNames is not meaningful by default,
hence the change in botmaster.py makes sure the builderNames is
taken form the configuration files list of builder.

Hence we can get rid of the environment work around (which also
did not honor non Autobuilder builders).

Signed-off-by: Stefan Agner <stefan at agner.ch>
---
 lib/python2.7/site-packages/autobuilder/Autobuilder.py  | 17 +++++++++--------
 .../buildbot/process/botmaster.py                       |  3 ++-
 .../buildbot-0.8.8-py2.7.egg/buildbot/status/master.py  | 12 ++----------
 3 files changed, 13 insertions(+), 19 deletions(-)

diff --git a/lib/python2.7/site-packages/autobuilder/Autobuilder.py b/lib/python2.7/site-packages/autobuilder/Autobuilder.py
index 4c33489..cf8672f 100644
--- a/lib/python2.7/site-packages/autobuilder/Autobuilder.py
+++ b/lib/python2.7/site-packages/autobuilder/Autobuilder.py
@@ -38,20 +38,21 @@ class Autobuilder:
                 self.cfile = "./buildset-config/yoctoAB.conf"
 
     def createBuildsets(self):
-        beenHere=[]
+        buildersSorted=[]
         sort = True
         if self.config.has_option('BuildSets', 'order'):
             sort = False
             for set in ast.literal_eval(self.config.get('BuildSets', 'order')):
-                beenHere.append(set)
+                buildersSorted.append(set)
+
         for key in self.configdict:
-            if key not in beenHere and key != "BuildSets":
-                beenHere.append(key)
+            if key not in buildersSorted and key != "BuildSets":
+                buildersSorted.append(key)
+
         if sort:
-            beenHere.sort()
-        # REALLY crappy way to do this, but better than setting globals.
-        os.environ["YOCTO_SORTED_BUILDERS"]= str(beenHere)
-        for buildset in beenHere:
+            util.naturalSort(buildersSorted)
+
+        for buildset in buildersSorted:
             self.schedprops = []
             self.checkoutprops={}
             self.set_props = {}
diff --git a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/process/botmaster.py b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/process/botmaster.py
index d5597f7..f2c3b9f 100644
--- a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/process/botmaster.py
+++ b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/process/botmaster.py
@@ -262,7 +262,8 @@ class BotMaster(config.ReconfigurableServiceMixin, service.MultiService):
                 builder.master = self.master
                 builder.setServiceParent(self)
 
-        self.builderNames = self.builders.keys()
+        # Use order according to configuration files builders list
+        self.builderNames = list([ (bc.name) for bc in new_config.builders ])
 
         metrics.MetricCountEvent.log("num_builders",
                 len(self.builders), absolute=True)
diff --git a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/master.py b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/master.py
index b5fe741..df122b4 100644
--- a/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/master.py
+++ b/lib/python2.7/site-packages/buildbot-0.8.8-py2.7.egg/buildbot/status/master.py
@@ -221,16 +221,8 @@ class Status(config.ReconfigurableServiceMixin, service.MultiService):
 
     def getBuilderNames(self, categories=None):
         if categories == None:
-            #YOCTO PROJECT ADDITION
-            import os
-            import ast
-            sortbuilders=""
-            sortbuilders=ast.literal_eval(os.environ.get('YOCTO_SORTED_BUILDERS'))
-            #I hate the way this is sorted. This is the laziest way to get this
-            #in the format I want.
-            return sortbuilders
-            #YOCTO PROJECT ADDITION
-            #return util.naturalSort(self.botmaster.builderNames) # don't let them break it
+            # assume this is already sorted...
+            return self.botmaster.builderNames
         
         l = []
         # respect addition order
-- 
1.9.0




More information about the yocto mailing list