.. versionadded:: 2017.7.0

    List prefetched packages downloaded by Yum in the local disk.

    CLI example:

    .. code-block:: bash

        salt '*' pkg.list_downloaded

def list_downloaded(**kwargs):
    '''
    .. versionadded:: 2017.7.0

    List prefetched packages downloaded by Yum in the local disk.

    CLI example:

    .. code-block:: bash

        salt '*' pkg.list_downloaded
    '''
    CACHE_DIR = os.path.join('/var/cache/', _yum())

    ret = {}
    for root, dirnames, filenames in salt.utils.path.os_walk(CACHE_DIR):
        for filename in fnmatch.filter(filenames, '*.rpm'):
            package_path = os.path.join(root, filename)
            pkg_info = __salt__['lowpkg.bin_pkg_info'](package_path)
            pkg_timestamp = int(os.path.getctime(package_path))
            ret.setdefault(pkg_info['name'], {})[pkg_info['version']] = {
                'path': package_path,
                'size': os.path.getsize(package_path),
                'creation_date_time_t': pkg_timestamp,
                'creation_date_time': datetime.datetime.fromtimestamp(pkg_timestamp).isoformat(),
            }
    return ret