|
|
69a90f |
From e62408838d08a962f1e1d6d8970b34ce1883a10c Mon Sep 17 00:00:00 2001
|
|
|
69a90f |
From: Pavel Moravec <pmoravec@redhat.com>
|
|
|
69a90f |
Date: Fri, 9 Sep 2016 09:21:23 +0200
|
|
|
69a90f |
Subject: [PATCH 1/2] [reporting] replace six.PY2 to six.PY3 test
|
|
|
69a90f |
|
|
|
69a90f |
Older versions of python-six package dont have six.PY2 variable.
|
|
|
69a90f |
|
|
|
69a90f |
Replace it by six.PY3
|
|
|
69a90f |
|
|
|
69a90f |
Resolves: #875.
|
|
|
69a90f |
|
|
|
69a90f |
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
|
|
69a90f |
---
|
|
|
69a90f |
sos/reporting.py | 6 +++---
|
|
|
69a90f |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
69a90f |
|
|
|
69a90f |
diff --git a/sos/reporting.py b/sos/reporting.py
|
|
|
69a90f |
index 23a5005..679284e 100644
|
|
|
69a90f |
--- a/sos/reporting.py
|
|
|
69a90f |
+++ b/sos/reporting.py
|
|
|
69a90f |
@@ -149,10 +149,10 @@ class PlainTextReport(object):
|
|
|
69a90f |
header, format_)
|
|
|
69a90f |
output = u'\n'.join(map(lambda i: (i if isinstance(i, six.text_type)
|
|
|
69a90f |
else six.u(i)), buf))
|
|
|
69a90f |
- if six.PY2:
|
|
|
69a90f |
- return output.encode('utf8')
|
|
|
69a90f |
- else:
|
|
|
69a90f |
+ if six.PY3:
|
|
|
69a90f |
return output
|
|
|
69a90f |
+ else:
|
|
|
69a90f |
+ return output.encode('utf8')
|
|
|
69a90f |
|
|
|
69a90f |
def process_subsection(self, section, key, header, format_):
|
|
|
69a90f |
if key in section:
|
|
|
69a90f |
--
|
|
|
69a90f |
2.4.11
|
|
|
69a90f |
|
|
|
69a90f |
From 04435b412f14f6d7eaf0d2138d9f8c84414a8e9a Mon Sep 17 00:00:00 2001
|
|
|
69a90f |
From: Pavel Moravec <pmoravec@redhat.com>
|
|
|
69a90f |
Date: Fri, 9 Sep 2016 09:23:14 +0200
|
|
|
69a90f |
Subject: [PATCH 2/2] [networking] plugin tracebacks when net-tools not
|
|
|
69a90f |
installed
|
|
|
69a90f |
|
|
|
69a90f |
Move netstat_pkg assignment grepping for net-tools version into try
|
|
|
69a90f |
block.
|
|
|
69a90f |
|
|
|
69a90f |
It can be put to the existing block that will catch the exception -
|
|
|
69a90f |
since if net-tools isn't present, we fallback to the default option
|
|
|
69a90f |
of netstat command (if the command is ever present).
|
|
|
69a90f |
|
|
|
69a90f |
Resolves: #876.
|
|
|
69a90f |
|
|
|
69a90f |
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
|
|
|
69a90f |
---
|
|
|
69a90f |
sos/plugins/networking.py | 2 +-
|
|
|
69a90f |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
69a90f |
|
|
|
69a90f |
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
|
|
|
69a90f |
index 93b8860..1c98b75 100644
|
|
|
69a90f |
--- a/sos/plugins/networking.py
|
|
|
69a90f |
+++ b/sos/plugins/networking.py
|
|
|
69a90f |
@@ -322,8 +322,8 @@ class RedHatNetworking(Networking, RedHatPlugin):
|
|
|
69a90f |
|
|
|
69a90f |
def setup(self):
|
|
|
69a90f |
# Handle change from -T to -W in Red Hat netstat 2.0 and greater.
|
|
|
69a90f |
- netstat_pkg = self.policy().package_manager.all_pkgs()['net-tools']
|
|
|
69a90f |
try:
|
|
|
69a90f |
+ netstat_pkg = self.policy().package_manager.all_pkgs()['net-tools']
|
|
|
69a90f |
# major version
|
|
|
69a90f |
if int(netstat_pkg['version'][0]) < 2:
|
|
|
69a90f |
self.ns_wide = "-T"
|
|
|
69a90f |
--
|
|
|
69a90f |
2.4.11
|
|
|
69a90f |
|