Blame SOURCES/sos-six-compat.patch

e75bc7
From b61a193b98b896164a8caefa088bb09297f1e3ca Mon Sep 17 00:00:00 2001
e75bc7
From: "Bryn M. Reeves" <bmr@redhat.com>
e75bc7
Date: Wed, 1 Oct 2014 17:08:50 +0100
e75bc7
Subject: [PATCH 1/2] [utilities] invert sense of six.PY2 test
e75bc7
e75bc7
Old versions of six do not include a 'PY2' attribute leading to
e75bc7
an exception in sos_get_command_output(). Invert the sense of the
e75bc7
test and check that six.PY3 is false instead as all versions of
e75bc7
the module include this attribute.
e75bc7
e75bc7
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
e75bc7
---
e75bc7
 sos/utilities.py | 2 +-
e75bc7
 1 file changed, 1 insertion(+), 1 deletion(-)
e75bc7
e75bc7
diff --git a/sos/utilities.py b/sos/utilities.py
e75bc7
index 7c06781..7e8cd7e 100644
e75bc7
--- a/sos/utilities.py
e75bc7
+++ b/sos/utilities.py
e75bc7
@@ -139,7 +139,7 @@ def sos_get_command_output(command, timeout=300, runat=None):
e75bc7
         command = "timeout %ds %s" % (timeout, command)
e75bc7
 
e75bc7
     # shlex.split() reacts badly to unicode on older python runtimes.
e75bc7
-    if six.PY2:
e75bc7
+    if not six.PY3:
e75bc7
         command = command.encode('utf-8')
e75bc7
     args = shlex.split(command)
e75bc7
     try:
e75bc7
-- 
e75bc7
1.9.3
e75bc7
e75bc7
e75bc7
From f9c811abc07f1e3044b1dbf29fdd5cd1f68812bc Mon Sep 17 00:00:00 2001
e75bc7
From: "Bryn M. Reeves" <bmr@redhat.com>
e75bc7
Date: Wed, 1 Oct 2014 17:34:56 +0100
e75bc7
Subject: [PATCH 2/2] [archive] invert sense of six.PY2 test
e75bc7
e75bc7
Old versions of six do not include a 'PY2' attribute leading to
e75bc7
an exception in sos_get_command_output(). Invert the sense of the
e75bc7
test and check that six.PY3 is false instead as all versions of
e75bc7
the module include this attribute.
e75bc7
e75bc7
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
e75bc7
---
e75bc7
 sos/archive.py | 2 +-
e75bc7
 1 file changed, 1 insertion(+), 1 deletion(-)
e75bc7
e75bc7
diff --git a/sos/archive.py b/sos/archive.py
e75bc7
index 245f904..2e42bbd 100644
e75bc7
--- a/sos/archive.py
e75bc7
+++ b/sos/archive.py
e75bc7
@@ -357,7 +357,7 @@ class TarFileArchive(FileCacheArchive):
e75bc7
 
e75bc7
     def _build_archive(self):
e75bc7
         # python2.6 TarFile lacks the filter parameter
e75bc7
-        if six.PY2 and sys.version_info[1] < 7:
e75bc7
+        if not six.PY3 and sys.version_info[1] < 7:
e75bc7
             tar = _TarFile.open(self._archive_name, mode="w")
e75bc7
         else:
e75bc7
             tar = tarfile.open(self._archive_name, mode="w")
e75bc7
-- 
e75bc7
1.9.3
e75bc7