import demistomock as demisto
from CommonServerPython import *


def get_cve():
    cve_id = demisto.args().get('cve_id')
    if not cve_id:
        return_error('Missing CVE ID.')

    return demisto.executeCommand('forescout-ei-vulnerability-info-get', {'cve_id': cve_id})


def main():
    try:
        return_results(get_cve())
    except Exception as e:
        demisto.error(fix_traceback_line_numbers(traceback.format_exc()))
        return_error(f'Failed to get pcap from Forescout EyeInspect incident.\nError:\n{e}')


if __name__ in ('__main__', '__builtin__', 'builtins'):
    main()
