[python-urllib2_kerberos: 7/8] Merge fixing the logging format patch to the previous one.
Matej Cepl
mcepl at fedoraproject.org
Mon Sep 15 22:02:20 UTC 2014
commit b1f79ccf36f15d7fa47d5f358a2c108fb5f9e9fd
Author: Matěj Cepl <mcepl at redhat.com>
Date: Thu Jul 3 16:14:44 2014 +0200
Merge fixing the logging format patch to the previous one.
correct-format-for-py26.patch | 73 ---------------------------------------
dont-panick-if-we-succeed.patch | 73 +++++++++++++++++++++++++++++++++++----
python-urllib2_kerberos.spec | 7 +---
3 files changed, 67 insertions(+), 86 deletions(-)
---
diff --git a/dont-panick-if-we-succeed.patch b/dont-panick-if-we-succeed.patch
index 6b6ee60..ecc330a 100644
--- a/dont-panick-if-we-succeed.patch
+++ b/dont-panick-if-we-succeed.patch
@@ -4,17 +4,76 @@
"""checks for "Negotiate" in proper auth header
"""
authreqs = headers.getheaders(self.auth_header)
-+ log.debug('authreqs = {}'.format(authreqs))
-
++ log.debug('authreqs = %s', authreqs)
+
if authreqs:
-
-@@ -126,7 +127,8 @@ class AbstractKerberosAuthHandler:
+
+@@ -43,10 +44,10 @@ class AbstractKerberosAuthHandler:
+ if mo:
+ return mo.group(1)
+ else:
+- log.debug("regex failed on: %s" % authreq)
++ log.debug("regex failed on: %s", authreq)
+
+ else:
+- log.debug("%s header not found" % self.auth_header)
++ log.debug("%s header not found", self.auth_header)
+
+ return None
+
+@@ -56,10 +57,10 @@ class AbstractKerberosAuthHandler:
+
+ def generate_request_header(self, req, headers, neg_value):
+ self.retried += 1
+- log.debug("retry count: %d" % self.retried)
++ log.debug("retry count: %d", self.retried)
+
+ host = req.get_host()
+- log.debug("req.get_host() returned %s" % host)
++ log.debug("req.get_host() returned %s", host)
+
+ tail, sep, head = host.rpartition(':')
+ domain = tail if tail else head
+@@ -67,7 +68,7 @@ class AbstractKerberosAuthHandler:
+ result, self.context = k.authGSSClientInit("HTTP@%s" % domain)
+
+ if result < 1:
+- log.warning("authGSSClientInit returned result %d" % result)
++ log.warning("authGSSClientInit returned result %d", result)
+ return None
+
+ log.debug("authGSSClientInit() succeeded")
+@@ -75,7 +76,7 @@ class AbstractKerberosAuthHandler:
+ result = k.authGSSClientStep(self.context, neg_value)
+
+ if result < 0:
+- log.warning("authGSSClientStep returned result %d" % result)
++ log.warning("authGSSClientStep returned result %d", result)
+ return None
+
+ log.debug("authGSSClientStep() succeeded")
+@@ -96,7 +97,7 @@ class AbstractKerberosAuthHandler:
+ if result < 1:
+ # this is a critical security warning
+ # should change to a raise --Tim
+- log.critical("mutual auth failed: authGSSClientStep returned result %d" % result)
++ log.critical("mutual auth failed: authGSSClientStep returned result %d", result)
+ pass
+
+ def clean_context(self):
+@@ -126,12 +127,13 @@ class AbstractKerberosAuthHandler:
req.add_unredirected_header(self.authz_header, neg_hdr)
resp = self.parent.open(req)
-
+
- self.authenticate_server(resp.info())
+ if resp.getcode() != 200:
+ self.authenticate_server(resp.info())
-
+
return resp
-
+
+ except k.GSSError, e:
+- log.critical("GSSAPI Error: %s/%s" % (e[0][0], e[1][0]))
++ log.critical("GSSAPI Error: %s/%s", (e[0][0], e[1][0]))
+ return None
+
+ finally:
diff --git a/python-urllib2_kerberos.spec b/python-urllib2_kerberos.spec
index 4dd7c08..d5a4815 100644
--- a/python-urllib2_kerberos.spec
+++ b/python-urllib2_kerberos.spec
@@ -14,11 +14,10 @@ Patch0: multiple-auth-headers.patch
# From https://bitbucket.org/tolsen/urllib2_kerberos/pull-request/2/
Patch1: allow_client_apps_to_configure_loggers.patch
# From https://github.com/mcepl/urllib2_kerberos/commit/7b52c4c749
+# also https://bugzilla.redhat.com/show_bug.cgi?id=1065576
Patch2: dont-panick-if-we-succeed.patch
# From https://bugzilla.redhat.com/show_bug.cgi?id=578711
Patch3: port-to-python-2.4.patch
-# From https://bugzilla.redhat.com/show_bug.cgi?id=1065576
-Patch4: correct-format-for-py26.patch
BuildArch: noarch
BuildRequires: python-setuptools
@@ -38,10 +37,6 @@ urllib2 with kerberos authentication.
%patch3 -p1
%endif
-%if 0%{?rhel} && 0%{?rhel} <= 6
-%patch4 -p1
-%endif
-
# Remove "#!/usr/bin/python\n"
lib=urllib2_kerberos.py
sed '1{\@^#!/usr/bin/python at d}' $lib > $lib.new && \
More information about the scm-commits
mailing list