Skip to content

Commit

Permalink
Cosmetic changes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
vg12345 committed Sep 4, 2024
1 parent 47b3e35 commit db30dcb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def main_flow(self):
self.logger.error("Couldn't retrieve telemetry data")
else:
# Detect ports to be isolated or deisolated
issues = pdr_alg.read_next_set_of_high_ber_or_pdr_ports(self.ports_data, ports_counters)
issues = pdr_alg.analyze_telemetry_data(self.ports_data, ports_counters)
except (KeyError,) as e:
self.logger.error(f"Failed to read information with error {e}")

Expand All @@ -316,7 +316,7 @@ def main_flow(self):
# deisolate ports
if self.do_deisolate:
for port_state in list(self.ports_states.values()):
if pdr_alg.should_deisolate(port_state):
if pdr_alg.check_deisolation_conditions(port_state):
self.eval_deisolate(port_state.name)
ports_updated = self.update_ports_data()
if ports_updated:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,11 @@ def check_ber_issue(self, port_obj, row, timestamp):
return Issue(port_obj.port_name, Constants.ISSUE_BER)
return None

def read_next_set_of_high_ber_or_pdr_ports(self, ports_data, ports_counters):
def analyze_telemetry_data(self, ports_data, ports_counters):
"""
Read the next set of ports and check if they have high BER, PDR, temperature or link downed issues
Receives: detected ports, isolated ports and telemetry data
Returns: lists of isolation issues
Returns: lists of isolation candidates
"""
self.ports_data = ports_data

Expand Down Expand Up @@ -448,8 +448,10 @@ def read_next_set_of_high_ber_or_pdr_ports(self, ports_data, ports_counters):
issues[port_name] = Constants.ISSUE_OONOC
return list(issues.values())

def should_deisolate(self, port_state):
def check_deisolation_conditions(self, port_state):
"""
Check if given port should be deisolated
Function doesn't perform deisolation itself, just checks deisolation conditions only
Return True if given port should be deisolated
"""
state = port_state.get_state()
Expand Down

0 comments on commit db30dcb

Please sign in to comment.