Exemplo n.º 1
0
def recodes_and_run(args):
    workspaceid, scan_schemeid = args[0], args[1]
    from scan.api.mudules.scan_v2.recode import collect_recodes
    runed_scripts = []

    recodes = collect_recodes(scheme_id=scan_schemeid, workspaceid=workspaceid)
    for x in recodes:
        result = push_cmd.delay(x.script)
        runed_scripts.append(x.script)
        x.task_id = result.id
        # 在这个环节可以把task_id都存下来便于下次
        x.save()
    return {
        "scripts_num": len(runed_scripts),
        "scripts": runed_scripts,
        "stat": True,
        "reason": "All OK of Tasks Scanner.",
        "workspaceid": workspaceid
    }
def test_recode():
    django_setup()

    from scan.api.mudules.scan_v2.recode import collect_recodes
    collect_recodes()
Exemplo n.º 3
0
def loads_service_to_recodes(prepare=None):
    from scan.api.mudules.scan_v2.recode import collect_recodes
    collect_recodes()

    return "Load Recode End."