aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2016-09-09 09:23:14 +0200
committerPavel Moravec <pmoravec@redhat.com>2016-09-09 09:23:14 +0200
commit04435b412f14f6d7eaf0d2138d9f8c84414a8e9a (patch)
treee5737505e03e7b23b2dbf14706d08baa0237757c
parente62408838d08a962f1e1d6d8970b34ce1883a10c (diff)
downloadsos-04435b412f14f6d7eaf0d2138d9f8c84414a8e9a.tar.gz
[networking] plugin tracebacks when net-tools not installed
Move netstat_pkg assignment grepping for net-tools version into try block. It can be put to the existing block that will catch the exception - since if net-tools isn't present, we fallback to the default option of netstat command (if the command is ever present). Resolves: #876. Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
-rw-r--r--sos/plugins/networking.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
index 93b88600..1c98b755 100644
--- a/sos/plugins/networking.py
+++ b/sos/plugins/networking.py
@@ -322,8 +322,8 @@ class RedHatNetworking(Networking, RedHatPlugin):
def setup(self):
# Handle change from -T to -W in Red Hat netstat 2.0 and greater.
- netstat_pkg = self.policy().package_manager.all_pkgs()['net-tools']
try:
+ netstat_pkg = self.policy().package_manager.all_pkgs()['net-tools']
# major version
if int(netstat_pkg['version'][0]) < 2:
self.ns_wide = "-T"