Commit 26003835 by David Baumgold

If cannot fetch people.yaml, entire script should fail

parent 1c4d1605
...@@ -382,21 +382,13 @@ def prs_by_email(start_ref, end_ref): ...@@ -382,21 +382,13 @@ def prs_by_email(start_ref, end_ref):
} }
# `emails` maps from other_emails to primary email, based on people.yaml. # `emails` maps from other_emails to primary email, based on people.yaml.
emails = {} emails = {}
try: people_resp = requests.get(PEOPLE_YAML, headers=headers)
people_resp = requests.get(PEOPLE_YAML, headers=headers) people_resp.raise_for_status()
people_resp.raise_for_status() people = yaml.safe_load(people_resp.text)
people = yaml.safe_load(people_resp.text) for person in people.itervalues():
except requests.exceptions.RequestException as e: if 'other_emails' in person:
# Hmm, muddle through without canonicalized emails... for other_email in person['other_emails']:
message = ( emails[other_email] = person['email']
"Warning: could not fetch people.yaml: {message}".format(message=e.message)
)
print(colorize("red", message), file=sys.stderr)
else:
for person in people.itervalues():
if 'other_emails' in person:
for other_email in person['other_emails']:
emails[other_email] = person['email']
unordered_data = collections.defaultdict(set) unordered_data = collections.defaultdict(set)
for pr_num in get_merged_prs(start_ref, end_ref): for pr_num in get_merged_prs(start_ref, end_ref):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment