Bug 1100775 - some try builds are missing binaries and artifacts in ftp, r=mgerva
authorJordan Lund <jlund@mozilla.com>
Tue, 18 Nov 2014 10:25:20 -0800 (2014-11-18)
changeset 3397 187d3e64f28f900c07243f08cacb4db29ee9cc46
parent 3396 c4060dfc1b65d903bd4574498b9c3d87c7d962d3
child 3399 51281fca375874dac905f97f944bee5b75903aa0
child 3400 26784cfb53ee7dd0061c7cab127efe370a79ff46
push id2624
push userjlund@mozilla.com
push dateTue, 18 Nov 2014 18:25:27 +0000 (2014-11-18)
reviewersmgerva
bugs1100775
Bug 1100775 - some try builds are missing binaries and artifacts in ftp, r=mgerva
mozharness/mozilla/building/buildbase.py
--- a/mozharness/mozilla/building/buildbase.py
+++ b/mozharness/mozilla/building/buildbase.py
@@ -839,24 +839,28 @@ or run without that action (ie: --no-{ac
     def _query_who(self):
         """ looks for who triggered the build with a change.
 
         This is used for things like try builds where the upload dir is
         associated with who pushed to try. First it will look in self.config
         and failing that, will poll buildbot_config
         If nothing is found, it will default to returning "nobody@example.com"
         """
-        _who = ''
+        _who = "nobody@example.com"
         if self.config.get('who'):
             _who = self.config['who']
-        if self.buildbot_config and 'sourcestamp' in self.buildbot_config:
-            if self.buildbot_config['sourcestamp'].get('who'):
-                _who = self.buildbot_config['sourcestamp']['who']
-        if not _who:
-            _who = "nobody@example.com"
+        else:
+            try:
+                if self.buildbot_config:
+                    _who = self.buildbot_config['sourcestamp']['changes'][0]['who']
+            except (KeyError, IndexError):
+                # KeyError: "sourcestamp" or "changes" or "who" not in buildbot_config
+                # IndexError: buildbot_config['sourcestamp']['changes'] is empty
+                # "who" is not available, using the default value
+                pass
         return _who
 
     def _query_post_upload_cmd(self):
         c = self.config
         post_upload_cmd = ["post_upload.py"]
         buildid = self.query_buildid()
         revision = self.query_revision()
         platform = self.stage_platform