autoland: use the new treestatus url and structure (
bug 1335735) r?mars
The old treestatus URL no longer works, and the JSON result has slightly
changed in structure.
MozReview-Commit-ID: HTnqU9UhZ9v
--- a/autoland/autoland/treestatus.py
+++ b/autoland/autoland/treestatus.py
@@ -1,30 +1,30 @@
import config
import re
import requests
-TREESTATUS_URL = 'https://treestatus.mozilla.org/'
+TREESTATUS_URL = 'https://treestatus.mozilla-releng.net/trees/'
def tree_is_open(logger, tree):
treestatus_url = TREESTATUS_URL
if config.testing():
treestatus_url = 'http://treestatus/'
# Map integration branches to their short form name
m = re.match('ssh://hg\.mozilla\.org/integration/([^/]+)', tree)
if m and m.groups():
tree = m.groups()[0]
r = None
try:
- r = requests.get(treestatus_url + tree + '?format=json', verify=False)
+ r = requests.get(treestatus_url + tree, verify=False)
if r.status_code == 200:
- return r.json()['status'] == 'open'
+ return r.json()['result']['status'] == 'open'
elif r.status_code == 404:
# We assume unrecognized trees are open
return True
else:
logger.error('Unexpected response from treestatus API '
'for tree "%s": %s' % (tree, r.status_code))
except KeyError:
logger.error('Malformed response from treestatus API '