From ff1829a3b0313d6596d814c884e4995b31c9909b Mon Sep 17 00:00:00 2001 From: Vitaly Gavensky Date: Sun, 19 May 2024 11:19:41 +0300 Subject: [PATCH] Temp: full simulation --- .../.pytest/run_simulation_pytest.sh | 1 - .../ufm_sim_web_service/isolation_mgr.py | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/pdr_deterministic_plugin/.pytest/run_simulation_pytest.sh b/plugins/pdr_deterministic_plugin/.pytest/run_simulation_pytest.sh index 002c6213e..ddf4c2be0 100644 --- a/plugins/pdr_deterministic_plugin/.pytest/run_simulation_pytest.sh +++ b/plugins/pdr_deterministic_plugin/.pytest/run_simulation_pytest.sh @@ -20,4 +20,3 @@ echo "Starting 'simulation_telemetry.py'" python $PLUGIN_DIR/tests/simulation_telemetry.py echo "Terminating 'isolation_algo.py'" pkill -9 -f isolation_algo.py 2>/dev/null || true -echo "Terminated 'isolation_algo.py'" diff --git a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/isolation_mgr.py b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/isolation_mgr.py index 8ebde143c..c8dc606e9 100644 --- a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/isolation_mgr.py +++ b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/isolation_mgr.py @@ -314,7 +314,8 @@ def eval_isolation(self, port_name, cause): log_message = f"Isolated port: {port_name} cause: {cause}. dry_run: {self.dry_run}" self.logger.warning(log_message) - self.ufm_client.send_event(log_message, event_id=Constants.EXTERNAL_EVENT_ALERT, external_event_name="Isolating Port") + if not self.test_mode: + self.ufm_client.send_event(log_message, event_id=Constants.EXTERNAL_EVENT_ALERT, external_event_name="Isolating Port") def eval_deisolate(self, port_name): @@ -372,8 +373,9 @@ def eval_deisolate(self, port_name): self.ports_states.pop(port_name) log_message = f"Deisolated port: {port_name}. dry_run: {self.dry_run}" self.logger.warning(log_message) - self.ufm_client.send_event(log_message, event_id=Constants.EXTERNAL_EVENT_NOTICE, external_event_name="Deisolating Port") - + if not self.test_mode: + self.ufm_client.send_event(log_message, event_id=Constants.EXTERNAL_EVENT_NOTICE, external_event_name="Deisolating Port") + def get_rate(self, port_obj, counter_name, new_val, timestamp): """ Calculate the rate of the counter @@ -901,7 +903,7 @@ def main_flow(self): self.logger.warning(event_msg) if not self.test_mode: self.ufm_client.send_event(event_msg, event_id=Constants.EXTERNAL_EVENT_ALERT, external_event_name="Skipping isolation") - + # deal with reported new issues else: for issue in issues.values():