(json_flow, flow=None)
return json_flow
Fixes duplicate rule UUIDs
Fixes duplicate rule UUIDs
Fixes duplicate rule UUIDs
def migrate_to_version_11_8(json_flow, flow=None):
    """
    Fixes duplicate rule UUIDs
    """
    seen_uuids = set()

    for rs in json_flow.get("rule_sets", []):
        for rule in rs.get("rules"):
            if rule.get("uuid") in seen_uuids or not rule.get("uuid"):
                rule["uuid"] = str(uuid4())
            seen_uuids.add(rule["uuid"])

    return json_flow
def migrate_to_version_11_8 ( json_flow , flow = None ) : seen_uuids = set ( ) for rs in json_flow . get ( "rule_sets" , [ ] ) : for rule in rs . get ( "rules" ) : if rule . get ( "uuid" ) in seen_uuids or not rule . get ( "uuid" ) : rule [ "uuid" ] = str ( uuid4 ( ) ) seen_uuids . add ( rule [ "uuid" ] ) return json_flow