aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2012-12-06 00:37:31 +0000
committerBryn M. Reeves <bmr@redhat.com>2012-12-06 00:37:31 +0000
commit04cc8afc0d4947d3647ae2bb92908d5e797a707a (patch)
tree7ee5028a83aaa717fe0e740613b9354838199259
parentd01ac0cab659952fba5ec11db7f781defa91d4da (diff)
downloadsos-04cc8afc0d4947d3647ae2bb92908d5e797a707a.tar.gz
Test for existence of script in hardware module
Test for the existence of the hardware.py script in the RedHatHardware module instead of relying on an exception from the output gathering functions.
-rw-r--r--sos/plugins/hardware.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sos/plugins/hardware.py b/sos/plugins/hardware.py
index 15ab6141..27c6ce0d 100644
--- a/sos/plugins/hardware.py
+++ b/sos/plugins/hardware.py
@@ -75,10 +75,10 @@ class RedHatHardware(hardware, RedHatPlugin):
def setup(self):
super(RedHatHardware, self).setup()
- try:
- self.collectExtOutput(glob("/usr/share/rhn/up2date*client/hardware.py"))
- except NameError:
- pass
+ hwpaths = glob("/usr/share/rhn/up2date*client/hardware.py")
+ if (len(hwpaths) == 0):
+ return
+ self.collectExtOutput(hwpaths[0])
class DebianHardware(hardware, DebianPlugin, UbuntuPlugin):