Mounts

This combiner provides information about mount entries. More specifically this consolidates data from insights.parsers.mount.Mount, insights.parsers.mount.ProcMounts and insights.parsers.mount.MountInfo.

Examples

>>> type(mounts)
<class 'insights.combiners.mounts.Mounts'>
>>> len(mounts)
19
>>> '/boot' in mounts
True
>>> mounts['/boot'].mount_source
'/dev/sda1'
>>> mounts['/boot'].mount_options.get('data')
'ordered'
>>> mounts['/boot'].mount_addtlinfo.major_minor
'8:1'
class insights.combiners.mounts.Mounts(binmount, procmounts, mountinfo)[source]

Bases: object

Mounts combiner consolidates data from the parsers in insights.parsers.mounts module.

rows

list of MountEntry objects for each mount entry

Type

list

get_dir(path)[source]

This finds the most specific mount path that contains the given path, by successively removing the directory or file name on the end of the path and seeing if that is a mount point. This will always terminate since / is always a mount point. Strings that are not absolute paths will return None.

Parameters

path (str) -- The path to check.

Returns

The mount point that contains the given path.

Return type

MountEntry

property mount_points

Returns: (list): list of mount_point for each mount entry

search(**kwargs)[source]

Returns a list of the mounts matching the given criteria. Keys are searched for directly - see the insights.parsers.keyword_search() utility function for more details. If no search parameters are given, no rows are returned.

Parameters

**kwargs (dict) -- Dictionary of key-value pairs to search for.

Returns

The list of mount points matching the given criteria.

Return type

(list)

Examples

>>> mounts.search(mount_point='/proc')[0]['mount_source']
'proc'
>>> mounts.search(mount_type__contains='nfs')[0]['mount_point']
'/shared/dir1'