summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhaokun <[email protected]>2024-10-10 14:51:24 +0800
committerzhaokun <[email protected]>2024-10-10 14:51:24 +0800
commit1e232b57157e1056d97fbb32dd274c699d4e6693 (patch)
tree00b51685b2585eb0c1bdc5af8ac32624bfa431e9
parentbf004c52670e8f0dbc7d0f20ec56c984d7ab7b8f (diff)
add judgement for active_flow parameter
-rw-r--r--app.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/app.py b/app.py
index c545d9b..cbe8cc4 100644
--- a/app.py
+++ b/app.py
@@ -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")