Skip to content

Commit

Permalink
Update alarm.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardusrendy committed Aug 8, 2024
1 parent 3c148ec commit d656a96
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions alab_management/alarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,7 @@ def alert(self, message: str, category: str):
"""
# if system is in simulation mode, do not send alert
if not self.sim_mode_flag:
for (
platform
) in self.platforms.items(): # pylint: disable=consider-using-dict-items
for platform in self.platforms: # pylint: disable=consider-using-dict-items
message_dict = {"message": message, "category": category}
if self.platforms[platform]:
try:
Expand Down Expand Up @@ -210,4 +208,5 @@ def print_configuration(self):
print("Email Receivers: ", self.email_receivers)
print("Email Sender: ", self.email_sender)
print("Slack Channel ID: ", self.slack_channel_id)
print("Sim Mode Flag: ", str(self.sim_mode_flag) + ". Will not send alerts in sim mode." if self.sim_mode_flag else "False")
print("Sim Mode Flag: ", str(self.sim_mode_flag) + ". Will not send alerts in sim mode."
if self.sim_mode_flag else "False")

0 comments on commit d656a96

Please sign in to comment.