diff options
| author | zhaokun <[email protected]> | 2024-10-10 14:51:24 +0800 |
|---|---|---|
| committer | zhaokun <[email protected]> | 2024-10-10 14:51:24 +0800 |
| commit | 1e232b57157e1056d97fbb32dd274c699d4e6693 (patch) | |
| tree | 00b51685b2585eb0c1bdc5af8ac32624bfa431e9 | |
| parent | bf004c52670e8f0dbc7d0f20ec56c984d7ab7b8f (diff) | |
add judgement for active_flow parameter
| -rw-r--r-- | app.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -84,7 +84,10 @@ def run_traffic_env(): yaml_name = json_data.get("yaml_name") + ".yaml" m = json_data.get("m") d = json_data.get("d") - active_flows = json_data.get("active_flows") + if "active_flows" in json_data: + active_flows = json_data.get("active_flows") + else: + active_flows = 0 clients_start_ip = json_data.get("clients_start_ip") clients_end_ip = json_data.get("clients_end_ip") servers_start_ip = json_data.get("servers_start_ip") |
