def create_vulnerability_dictionary(qid, title,
                                    ip, name, category, severity,
                                    solution, diagnosis, consequence):
    """
    Creates a vulnerability dictionary.
    :param qid: integer Qualys ID of the vulnerability.
    :param title: string, title of the vulnerability.
    :param ip: list of IP adresses (strings) affected by vulnerability.
    :param name: hostname associated to the IP
    :param category: string, category of vulnerability.
    :param severity: integer, severity level of the vulnerability.
    :param solution: string, how to fix the vulnerability.
    :param diagnosis: string, how the vulnerability was detected.
    :param consequence: string, consequences of the vulnerability.
    :return: vulnerability dictionary with the entered values.
    """
    return {
        'qid': qid,
        'title': title,
        'hosts': [{'ip': ip, 'name': name}],
        'category': category,
        'severity': severity,
        'solution': solution,
        'diagnosis': diagnosis,
        'consequence': consequence,
    }