From 793722996da7f8c9120c678b16350363d30c6bf1 Mon Sep 17 00:00:00 2001 From: Gilles Dartiguelongue Date: Sun, 22 Jan 2017 12:39:41 +0100 Subject: sync: use assert for GLEP67 compliance check Should never be raised actually but who knows. --- backend/lib/sync.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/lib/sync.py b/backend/lib/sync.py index 7c499b5..ba31477 100644 --- a/backend/lib/sync.py +++ b/backend/lib/sync.py @@ -175,15 +175,17 @@ def sync_versions(): maintainers = [] if 'maintainers' in pkg: for maint in pkg['maintainers']: - if 'email' not in maint: - print("WARNING: Package %s was told to have a maintainer without an e-mail identifier" % package.full_name) - continue + assert ( + 'email' in maint and 'type' in maint, + "Package %s maintainer %s entry not GLEP 67 valid" % (package.full_name, maint) + ) + email = maint['email'].lower() if email in existing_maintainers: maintainers.append(existing_maintainers[email]) else: is_project = False - if 'type' in maint and maint['type'] == 'project': + if maint['type'] == 'project': is_project = True print("Adding %s maintainer %s" % ("project" if is_project else "individual", email)) new_maintainer = Maintainer(email=email, is_project=is_project, name=maint['name'] if 'name' in maint else None) -- cgit v1.2.3-65-gdbad