Bug 1306421 - Add is_taskcluster to ScriptMixin; r?armenzg draft
authorGregory Szorc <gps@mozilla.com>
Thu, 29 Sep 2016 12:50:57 -0700
changeset 419171 0da7795000aea39d620cb7c076196b3a0cfaa30b
parent 419033 9baec74b3db1bf005c66ae2f50bafbdb02c3be38
child 419172 f0f7c6818656e701a12441157774bcb515ec4023
push id30867
push userbmo:gps@mozilla.com
push dateThu, 29 Sep 2016 20:06:31 +0000
reviewersarmenzg
bugs1306421
milestone52.0a1
Bug 1306421 - Add is_taskcluster to ScriptMixin; r?armenzg So we can detect when we're running on TaskCluster. This will be used to adjust environment settings accordingly. MozReview-Commit-ID: JEG1E3tWsc5
testing/mozharness/mozharness/base/script.py
--- a/testing/mozharness/mozharness/base/script.py
+++ b/testing/mozharness/mozharness/base/script.py
@@ -1662,16 +1662,20 @@ class ScriptMixin(PlatformMixin):
                         bundle.extract(entry, path=extract_to)
             except tarfile.TarError as e:
                 self.log('%s (%s)' % (e.message, filename),
                          level=error_level, exit_code=fatal_exit_code)
         else:
             self.log('No extraction method found for: %s' % filename,
                      level=error_level, exit_code=fatal_exit_code)
 
+    def is_taskcluster(self):
+        """Returns boolean indicating if we're running in TaskCluster."""
+        return 'TASKCLUSTER_INSTANCE_TYPE' in os.environ
+
 
 def PreScriptRun(func):
     """Decorator for methods that will be called before script execution.
 
     Each method on a BaseScript having this decorator will be called at the
     beginning of BaseScript.run().
 
     The return value is ignored. Exceptions will abort execution.