From 71eb9e1338dabdedafc2876468a6733e85f8e45f Mon Sep 17 00:00:00 2001 From: Jake Hunsaker Date: Fri, 7 Dec 2018 11:30:45 -0500 Subject: [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 --- sos/plugins/fibrechannel.py | 15 +-------------- 1 file changed, 1 insertion(+), 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 : -- cgit