Bug 1311199 - Don't assume `stage_server` config properties exist when creating the mach build environment; r?catlee
MozReview-Commit-ID: LtmvWpFBDje
--- a/testing/mozharness/mozharness/mozilla/building/buildbase.py
+++ b/testing/mozharness/mozharness/mozilla/building/buildbase.py
@@ -903,25 +903,25 @@ or run without that action (ie: --no-{ac
def query_mach_build_env(self, multiLocale=None):
c = self.config
if multiLocale is None and self.query_is_nightly():
multiLocale = c.get('multi_locale', False)
mach_env = {}
if c.get('upload_env'):
mach_env.update(c['upload_env'])
- if 'UPLOAD_HOST' in mach_env:
+ if 'UPLOAD_HOST' in mach_env and 'stage_server' in c:
mach_env['UPLOAD_HOST'] = mach_env['UPLOAD_HOST'] % {
'stage_server': c['stage_server']
}
- if 'UPLOAD_USER' in mach_env:
+ if 'UPLOAD_USER' in mach_env and 'stage_username' in c:
mach_env['UPLOAD_USER'] = mach_env['UPLOAD_USER'] % {
'stage_username': c['stage_username']
}
- if 'UPLOAD_SSH_KEY' in mach_env:
+ if 'UPLOAD_SSH_KEY' in mach_env and 'stage_ssh_key' in c:
mach_env['UPLOAD_SSH_KEY'] = mach_env['UPLOAD_SSH_KEY'] % {
'stage_ssh_key': c['stage_ssh_key']
}
if self.query_is_nightly():
mach_env['LATEST_MAR_DIR'] = c['latest_mar_dir'] % {
'branch': self.branch
}