[python-fedmsg-meta-fedora-infrastructure] Patch to handle github edge case.

Ralph Bean ralph at fedoraproject.org
Sat Jul 12 00:20:59 UTC 2014


commit 2c712c6a85c4f00cdf9a3c6afb355db89121dc08
Author: Ralph Bean <rbean at redhat.com>
Date:   Fri Jul 11 20:21:03 2014 -0400

    Patch to handle github edge case.

 ...dmsg-meta-fedora-infrastructure-edge-case.patch |   27 ++++++++++++++++++++
 python-fedmsg-meta-fedora-infrastructure.spec      |   10 ++++++-
 2 files changed, 36 insertions(+), 1 deletions(-)
---
diff --git a/python-fedmsg-meta-fedora-infrastructure-edge-case.patch b/python-fedmsg-meta-fedora-infrastructure-edge-case.patch
new file mode 100644
index 0000000..bba5df7
--- /dev/null
+++ b/python-fedmsg-meta-fedora-infrastructure-edge-case.patch
@@ -0,0 +1,27 @@
+From 895dab10ab8d1881c75cb53d52cab30afb22603e Mon Sep 17 00:00:00 2001
+From: Ralph Bean <rbean at redhat.com>
+Date: Fri, 11 Jul 2014 20:16:03 -0400
+Subject: [PATCH] Handle an edge case with github messages.
+
+---
+ fedmsg_meta_fedora_infrastructure/github.py | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/fedmsg_meta_fedora_infrastructure/github.py b/fedmsg_meta_fedora_infrastructure/github.py
+index 073ed96..3d625d0 100644
+--- a/fedmsg_meta_fedora_infrastructure/github.py
++++ b/fedmsg_meta_fedora_infrastructure/github.py
+@@ -31,7 +31,9 @@ class GithubProcessor(BaseProcessor):
+ 
+     def _get_user(self, msg):
+         if msg['msg'].get('commit', None):
+-            user = msg['msg']['commit'].get('author', {}).get('login', {})
++            user = msg['msg']['commit'].get('author')
++            if user:
++                user = user.get('login')
+             if user:
+                 return msg['msg']['fas_usernames'].get(user, user)
+         if msg['msg'].get('pusher', None):
+-- 
+1.9.3
+
diff --git a/python-fedmsg-meta-fedora-infrastructure.spec b/python-fedmsg-meta-fedora-infrastructure.spec
index 6350ae4..8aaa6e5 100644
--- a/python-fedmsg-meta-fedora-infrastructure.spec
+++ b/python-fedmsg-meta-fedora-infrastructure.spec
@@ -2,7 +2,7 @@
 
 Name:               python-fedmsg-meta-fedora-infrastructure
 Version:            0.2.15
-Release:            1%{?dist}
+Release:            2%{?dist}
 Summary:            Metadata providers for Fedora Infrastructure's fedmsg deployment
 
 Group:              Development/Libraries
@@ -10,6 +10,9 @@ License:            LGPLv2+
 URL:                http://pypi.python.org/pypi/%{modname}
 Source0:            http://pypi.python.org/packages/source/f/%{modname}/%{modname}-%{version}.tar.gz
 
+# https://github.com/fedora-infra/fedmsg_meta_fedora_infrastructure/pull/115
+Patch0:             python-fedmsg-meta-fedora-infrastructure-edge-case.patch
+
 BuildArch:          noarch
 
 
@@ -47,6 +50,8 @@ your messages.
 %prep
 %setup -q -n %{modname}-%{version}
 
+%patch0 -p1
+
 # Remove bundled egg-info in case it exists
 rm -rf %{modname}.egg-info
 
@@ -71,6 +76,9 @@ rm -rf %{modname}.egg-info
 %{python_sitelib}/%{modname}-%{version}*
 
 %changelog
+* Fri Jul 11 2014 Ralph Bean <rbean at redhat.com> - 0.2.15-2
+- Patch to handle github edge case.
+
 * Thu Jul 10 2014 Ralph Bean <rbean at redhat.com> - 0.2.15-1
 - New kerneltest processor
 - Fixes to pkgdb, coprs, elections, github, and releng.


More information about the scm-commits mailing list