aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Hunsaker <jhunsake@redhat.com>2018-12-07 11:30:45 -0500
committerJake Hunsaker <jhunsake@redhat.com>2020-04-07 16:43:35 -0400
commit71eb9e1338dabdedafc2876468a6733e85f8e45f (patch)
treedc2bb0eea8d598d4590fc8965d8fdf047d9f6cee
parentf36f65e61256290c01e8bb4cab18d5a7d1c2929b (diff)
downloadsos-71eb9e1338dabdedafc2876468a6733e85f8e45f.tar.gz
[fibrechannel] Use new add_blockdev_cmd method
Updates the fibrechannel plugin to replace the ad-hoc device enumeration with the new add_blockdev_cmd method. Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r--sos/plugins/fibrechannel.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/sos/plugins/fibrechannel.py b/sos/plugins/fibrechannel.py
index 7f41fbd2..89e61f6a 100644
--- a/sos/plugins/fibrechannel.py
+++ b/sos/plugins/fibrechannel.py
@@ -10,9 +10,6 @@
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"""
@@ -22,16 +19,6 @@ class Fibrechannel(Plugin, RedHatPlugin):
files = ('/sys/class/fc_host')
def setup(self):
-
- dirs = [
- '/sys/class/fc_host/',
- '/sys/class/fc_remote_ports/',
- '/sys/class/fc_transport/',
- '/sys/class/fc_vports/'
- ]
-
- devs = [join(d, dev) for d in dirs if isdir(d) for dev in listdir(d)]
- if devs:
- self.add_udev_info(devs, attrs=True)
+ self.add_blockdev_cmd("udevadm info -a %(dev)s", devices='fibre')
# vim: set et ts=4 sw=4 :