Combined NFS exports

The NFS exports files are normally available to rules from both a single NFSExports object and zero or more NFSExportsD objects. This combiner turns those into one set of data.


>>> type(all_nfs)
<class 'insights.combiners.nfs_exports.AllNFSExports'>
>>> all_nfs.files  # List of files exporting NFS shares
['/etc/exports', '/etc/exports.d/mnt.exports']
>>> '/home/example' in all_nfs.exports  # All exports stored by path
>>> sorted(all_nfs.exports['/home/example'].keys())  # Each path is a dictionary of host specs and flags.
['@group', '', '']
>>> all_nfs.exports['/home/example']['']  # Each host contains a list of flags.
['rw', 'sync', 'no_root_squash']
>>> '/home/example' in all_nfs.ignored_exports  # Ignored exports are remembered within one file
>>> list(all_nfs.ignored_exports['/home/example'].keys())  # Each ignored export is then stored by source file...
>>> list(all_nfs.ignored_exports['/home/example']['/etc/exports'].keys())  # ... and then by host spec...
>>> all_nfs.ignored_exports['/home/example']['/etc/exports']['']  # ... holding the values that were duplicated
['rw', 'sync', 'no_root_squash']
>>> '/home/insights/shared/rw'  in all_nfs.ignored_exports  # Ignored exports are remembered across files
class insights.combiners.nfs_exports.AllNFSExports(nfsexports, nfsexportsd)[source]

Bases: object

Combiner for accessing all the NFS export configuration files.

Exports are allowed to be listed multiple times, with all duplicate host after the first causing exportfs to emit a warning and ignore the host. So we combine the raw lines and ignored exports into structures listing the source file for each


the list of source files that contained NFS export definitions.


the NFS exports stored by export path, with each path storing a dictionary of host flag lists.

Type:dict of dicts

A dictionary of exported paths that have host definitions that conflicted with a previous definition, stored by export path and then path of the file that defined it.


A dictionary of raw lines that define each exported path, with the lines stored by defining file.

Type:dict of dicts