.. versionadded:: 2018.3.0

    Return information about known host entries from the configfile, if any.
    If there are no entries for a matching hostname, return None.

    CLI Example:

    .. code-block:: bash

        salt '*' ssh.get_known_host_entries <user> <hostname>

def get_known_host_entries(user,
                           hostname,
                           config=None,
                           port=None,
                           fingerprint_hash_type=None):
    '''
    .. versionadded:: 2018.3.0

    Return information about known host entries from the configfile, if any.
    If there are no entries for a matching hostname, return None.

    CLI Example:

    .. code-block:: bash

        salt '*' ssh.get_known_host_entries <user> <hostname>
    '''
    full = _get_known_hosts_file(config=config, user=user)

    if isinstance(full, dict):
        return full

    ssh_hostname = _hostname_and_port_to_ssh_hostname(hostname, port)
    cmd = ['ssh-keygen', '-F', ssh_hostname, '-f', full]
    lines = __salt__['cmd.run'](cmd,
                                ignore_retcode=True,
                                python_shell=False).splitlines()
    known_host_entries = list(
        _parse_openssh_output(lines,
                              fingerprint_hash_type=fingerprint_hash_type)
    )
    return known_host_entries if known_host_entries else None