Bug 1175701 - Windows Puppet machines failing on sendchange, adds multi exe support, r=mshal
authorJordan Lund <jlund@mozilla.com>
Wed, 01 Jul 2015 10:27:05 -0700 (2015-07-01)
changeset 4212 af321e00421047999b71867e915008a03f28888f
parent 4208 3a852c322edfbdad06d55666fa5d81a12faeb881
child 4213 50903ae436e5a9b1ec8255a765ea56f6a30911a2
child 4214 2a34e0fb39685e464fbc537dcbd2893a02789ed6
push id3352
push userjlund@mozilla.com
push dateWed, 01 Jul 2015 17:27:11 +0000 (2015-07-01)
reviewersmshal
bugs1175701
Bug 1175701 - Windows Puppet machines failing on sendchange, adds multi exe support, r=mshal
configs/builds/releng_base_windows_32_builds.py
configs/builds/releng_base_windows_64_builds.py
mozharness/base/script.py
--- a/configs/builds/releng_base_windows_32_builds.py
+++ b/configs/builds/releng_base_windows_32_builds.py
@@ -25,20 +25,26 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'hgtool.py': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'tools', 'buildfarm', 'utils', 'hgtool.py'
             )
         ],
-        "buildbot": [
-            sys.executable,
-            'c:\\mozilla-build\\buildbotve\\scripts\\buildbot'
-        ],
+        "buildbot": {
+            'gpo_location': [
+                sys.executable,
+                'c:\\mozilla-build\\buildbotve\\scripts\\buildbot'
+            ],
+            'puppet_location': [
+                sys.executable,
+                'c:\\mozilla-build\\buildbot-0.8.4-pre-moz6\\scripts\\buildbot'
+            ]
+        },
         "make": [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'build', 'pymake', 'make.py'
             )
         ],
         'virtualenv': [
             sys.executable,
--- a/configs/builds/releng_base_windows_64_builds.py
+++ b/configs/builds/releng_base_windows_64_builds.py
@@ -25,20 +25,26 @@ config = {
     'exes': {
         'python2.7': sys.executable,
         'hgtool.py': [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'tools', 'buildfarm', 'utils', 'hgtool.py'
             )
         ],
-        "buildbot": [
-            sys.executable,
-            'c:\\mozilla-build\\buildbotve\\scripts\\buildbot'
-        ],
+        "buildbot": {
+            'gpo_location': [
+                sys.executable,
+                'c:\\mozilla-build\\buildbotve\\scripts\\buildbot'
+            ],
+            'puppet_location': [
+                sys.executable,
+                'c:\\mozilla-build\\buildbot-0.8.4-pre-moz6\\scripts\\buildbot'
+            ]
+        },
         "make": [
             sys.executable,
             os.path.join(
                 os.getcwd(), 'build', 'src', 'build', 'pymake', 'make.py'
             )
         ],
         'virtualenv': [
             sys.executable,
--- a/mozharness/base/script.py
+++ b/mozharness/base/script.py
@@ -940,22 +940,45 @@ class ScriptMixin(PlatformMixin):
         if default is None:
             default = exe_name
         exe = self.config.get(exe_dict, {}).get(exe_name, default)
         repl_dict = {}
         if hasattr(self.script_obj, 'query_abs_dirs'):
             # allow for 'make': '%(abs_work_dir)s/...' etc.
             dirs = self.script_obj.query_abs_dirs()
             repl_dict.update(dirs)
-        if isinstance(exe, list) or isinstance(exe, tuple):
+        if isinstance(exe, dict):
+            found = False
+            # allow for searchable paths of the buildbot exe
+            for name, path in exe.iteritems():
+                if isinstance(path, list) or isinstance(path, tuple):
+                    path = [x % repl_dict for x in path]
+                    if all([os.path.exists(section) for section in path]):
+                        found = True
+                elif isinstance(path, str):
+                    path = path % repl_dict
+                    if os.path.exists(path):
+                        found = True
+                else:
+                    self.log("a exes %s dict's value is not a string, list, or tuple. Got key "
+                             "%s and value %s" % (exe_name, name, str(path)), level=error_level)
+                if found:
+                    exe = path
+                    break
+            else:
+                self.log("query_exe was a searchable dict but an existing path could not be "
+                         "determined. Tried searching in paths: %s" % (str(exe)), level=error_level)
+                return None
+        elif isinstance(exe, list) or isinstance(exe, tuple):
             exe = [x % repl_dict for x in exe]
         elif isinstance(exe, str):
             exe = exe % repl_dict
         else:
-            self.log("query_exe: %s is not a list, tuple or string: %s!" % (exe_name, str(exe)), level=error_level)
+            self.log("query_exe: %s is not a list, tuple, dict, or string: "
+                     "%s!" % (exe_name, str(exe)), level=error_level)
             return exe
         if return_type == "list":
             if isinstance(exe, str):
                 exe = [exe]
         elif return_type == "string":
             if isinstance(exe, list):
                 exe = subprocess.list2cmdline(exe)
         elif return_type is not None: