summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlinaro_metrics/sync_github_changes.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/linaro_metrics/sync_github_changes.py b/linaro_metrics/sync_github_changes.py
index 682b22f..33d41be 100755
--- a/linaro_metrics/sync_github_changes.py
+++ b/linaro_metrics/sync_github_changes.py
@@ -113,9 +113,15 @@ def _get(url):
try:
return urllib2.urlopen(request)
except urllib2.HTTPError as e:
+ error_code = e.getcode()
log.error('HTTP_%d while GETing %s:\n %s',
- e.getcode(), url, e.readlines())
- sys.exit(1)
+ error_code, url, e.readlines())
+ # 404 not found shouldn't be fatal.. make this
+ # a list in case there are others
+ if error_code in [404]:
+ return None
+ else:
+ sys.exit(1)
def get_pull_requests(owner, repo, last_update=None):
@@ -124,6 +130,8 @@ def get_pull_requests(owner, repo, last_update=None):
url = url % (owner, repo)
while url:
resp = _get(url)
+ if resp is None:
+ return
data = json.loads(resp.read())
for x in data:
ts = datetime.strptime(x['updated_at'], '%Y-%m-%dT%H:%M:%SZ')