aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/plugins/fibrechannel.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/sos/plugins/fibrechannel.py b/sos/plugins/fibrechannel.py
index 570c385e..fdca6d47 100644
--- a/sos/plugins/fibrechannel.py
+++ b/sos/plugins/fibrechannel.py
@@ -8,9 +8,11 @@
#
# See the LICENSE file in the source distribution for further information.
-import os
from sos.plugins import Plugin, RedHatPlugin
+from os import listdir
+from os.path import isdir, join
+
class Fibrechannel(Plugin, RedHatPlugin):
'''Collects information on fibrechannel devices, if present'''
@@ -21,17 +23,13 @@ class Fibrechannel(Plugin, RedHatPlugin):
def setup(self):
- devs = []
dirs = [
'/sys/class/fc_host/',
'/sys/class/fc_remote_ports/',
'/sys/class/fc_transport/'
]
- for loc in dirs:
- devs.extend([loc + device for device in os.listdir(loc)
- if os.path.isdir(loc)])
-
+ devs = [join(d, dev) for d in dirs for dev in listdir(d) if isdir(d)]
if devs:
self.add_udev_info(devs, attrs=True)