commit:     793722996da7f8c9120c678b16350363d30c6bf1
Author:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 22 11:39:41 2017 +0000
Commit:     Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
CommitDate: Sun Jan 22 12:00:20 2017 +0000
URL:        https://gitweb.gentoo.org/proj/grumpy.git/commit/?id=79372299

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)

Reply via email to