def rm_filesystems(name, device, config='/etc/filesystems'):
    '''
    .. versionadded:: 2018.3.3

    Remove the mount point from the filesystems

    CLI Example:

    .. code-block:: bash

        salt '*' mount.rm_filesystems /mnt/foo /dev/sdg
    '''
    modified = False
    view_lines = []

    if 'AIX' not in __grains__['kernel']:
        return modified

    criteria = _FileSystemsEntry(name=name, dev=device)
    try:
        fsys_filedict = _filesystems(config, False)
        for fsys_view in six.viewitems(fsys_filedict):
            try:
                if criteria.match(fsys_view):
                    modified = True
                else:
                    view_lines.append(fsys_view)

            except _FileSystemsEntry.ParseError:
                view_lines.append(fsys_view)

    except (IOError, OSError) as exc:
        raise CommandExecutionError("Couldn't read from {0}: {1}".format(config, exc))

    if modified:
        try:
            with salt.utils.files.fopen(config, 'wb') as ofile:
                for fsys_view in view_lines:
                    entry = fsys_view[1]
                    mystrg = _FileSystemsEntry.dict_to_lines(entry)
                    ofile.writelines(salt.utils.data.encode(mystrg))
        except (IOError, OSError) as exc:
            raise CommandExecutionError("Couldn't write to {0}: {1}".format(config, exc))

    return modified
def rm_filesystems ( name , device , config = '/etc/filesystems' ) : modified = False view_lines = [ ] if 'AIX' not in __grains__ [ 'kernel' ] : return modified criteria = _FileSystemsEntry ( name = name , dev = device ) try : fsys_filedict = _filesystems ( config , False ) for fsys_view in six . viewitems ( fsys_filedict ) : try : if criteria . match ( fsys_view ) : modified = True else : view_lines . append ( fsys_view ) except _FileSystemsEntry . ParseError : view_lines . append ( fsys_view ) except ( IOError , OSError ) as exc : raise CommandExecutionError ( "Couldn't read from {0}: {1}" . format ( config , exc ) ) if modified : try : with salt . utils . files . fopen ( config , 'wb' ) as ofile : for fsys_view in view_lines : entry = fsys_view [ 1 ] mystrg = _FileSystemsEntry . dict_to_lines ( entry ) ofile . writelines ( salt . utils . data . encode ( mystrg ) ) except ( IOError , OSError ) as exc : raise CommandExecutionError ( "Couldn't write to {0}: {1}" . format ( config , exc ) ) return modified
.. versionadded:: 2018.3.3

    Remove the mount point from the filesystems

    CLI Example:

    .. code-block:: bash

        salt '*' mount.rm_filesystems /mnt/foo /dev/sdg