Return a dict containing information on active swap

    .. versionchanged:: 2016.3.2

    CLI Example:

    .. code-block:: bash

        salt '*' mount.swaps

def swaps():
    '''
    Return a dict containing information on active swap

    .. versionchanged:: 2016.3.2

    CLI Example:

    .. code-block:: bash

        salt '*' mount.swaps
    '''
    ret = {}
    if __grains__['kernel'] == 'SunOS':
        for line in __salt__['cmd.run_stdout']('swap -l').splitlines():
            if line.startswith('swapfile'):
                continue
            comps = line.split()
            ret[comps[0]] = {'type': 'device' if comps[0].startswith(('/dev', 'swap')) else 'file',
                             'size': int(comps[3]),
                             'used': (int(comps[3]) - int(comps[4])),
                             'priority': '-'}
    elif 'AIX' in __grains__['kernel']:
        for line in __salt__['cmd.run_stdout']('swap -l').splitlines():
            if line.startswith('device'):
                continue
            comps = line.split()

            # AIX uses MB for units
            ret[comps[0]] = {'type': 'device',
                             'size': int(comps[3][:-2]) * 1024,
                             'used': (int(comps[3][:-2]) - int(comps[4][:-2])) * 1024,
                             'priority': '-'}
    elif __grains__['os'] != 'OpenBSD':
        with salt.utils.files.fopen('/proc/swaps') as fp_:
            for line in fp_:
                line = salt.utils.stringutils.to_unicode(line)
                if line.startswith('Filename'):
                    continue
                comps = line.split()
                ret[comps[0]] = {'type': comps[1],
                                 'size': comps[2],
                                 'used': comps[3],
                                 'priority': comps[4]}
    else:
        for line in __salt__['cmd.run_stdout']('swapctl -kl').splitlines():
            if line.startswith(('Device', 'Total')):
                continue
            swap_type = "file"
            comps = line.split()
            if comps[0].startswith('/dev/'):
                swap_type = "partition"
            ret[comps[0]] = {'type': swap_type,
                             'size': comps[1],
                             'used': comps[2],
                             'priority': comps[5]}
    return ret