Skip to content

Commit

Permalink
Temp: full simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
vg12345 committed May 19, 2024
1 parent 9ecf0aa commit ff1829a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'"
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit ff1829a

Please sign in to comment.