PciRportTargetDiskPath

Module for parsing the output of command find /sys/devices/ -maxdepth 10 -mindepth 9 -name stat -type f.

class insights.parsers.pci_rport_target_disk_paths.PciRportTargetDiskPaths(context, extra_bad_lines=None)[source]

Bases: insights.core.CommandParser

Class for parsing find /sys/devices/ -maxdepth 10 -mindepth 9 -name stat -type f command output.

Typical output of command find /sys/devices/ -maxdepth 10 -mindepth 9 -name stat -type f with the filter of ‘block’ looks like:

/sys/devices/pci0000:00/0000:00:01.0/0000:04:00.6/host1/rport-1:0-1/target1:0:0/1:0:0:0/block/sdb/stat
/sys/devices/pci0000:00/0000:00:01.0/0000:04:00.7/host2/rport-2:0-2/target2:0:0/2:0:0:0/block/sdc/stat
/sys/devices/pci0000:00/0000:00:02.2/0000:02:00.0/host0/target0:1:0/0:1:0:0/block/sda/stat

The Original data parsed looks like:

[
       {
           'target': 'target1:0:0',
           'devnode': 'sdb',
           'host_channel_id_lun': '1:0:0:0',
           'pci_id': '0000:04:00.6',
           'host': 'host1',
           'rport': 'rport-1:0-1'
       },
       {
           'target': 'target2:0:0',
           'devnode': 'sdc',
           'host_channel_id_lun': '2:0:0:0',
           'pci_id': '0000:04:00.7',
           'host': 'host2',
           'rport': 'rport-2:0-2'
       },
       {
           'target': 'target0:1:0',
           'devnode': 'sda',
           'host_channel_id_lun': '0:1:0:0',
           'pci_id': '0000:02:00.0',
           'host': 'host0',
       }
]

Examples

>>> type(pd)
<class 'insights.parsers.pci_rport_target_disk_paths.PciRportTargetDiskPaths'>
>>> pd.pci_id
['0000:02:00.0', '0000:04:00.6', '0000:04:00.7']
>>> pd.host
['host0', 'host1', 'host2']
>>> pd.target
['target0:1:0', 'target1:0:0', 'target2:0:0']
>>> pd.host_channel_id_lun
['0:1:0:0', '1:0:0:0', '2:0:0:0']
>>> pd.devnode
['sda', 'sdb', 'sdc']
Raises
path_list

the result parsed

Type

list

property devnode

The all devicenode(s) from parsed content.

Returns

device nodes

Return type

list

property host

The all host(s) from parsed content.

Returns

hosts

Return type

list

property host_channel_id_lun

The all host_channel_id_lun(s) from parsed content

Returns

host_channel_id_lun

Return type

list

parse_content(content)[source]

This method must be implemented by classes based on this class.

property pci_id

The all pci_id(s) from parsed content.

Returns

pci id

Return type

list

property rport

The all rport(s) from parsed content.

Returns

rports

Return type

list

property target

The all target(s) from parsed content.

Returns

targets

Return type

list