Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4099606: PDR plugin: Traceback: AttributeError: 'dict' object has no attribute 'active_speed' #266

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ def _remove_files(self, files: list) -> None:
:param files: (List) List of files to be removed
:return: None
"""
self.logger.info(f"removing {len(files)} old files")
self.logger.info(f"Removing {len(files)} old files")
for file in files:
try:
if exists(file):
remove(file)
except FileNotFoundError:
pass
except OSError as exc:
self.logger.error("failed to remove file %s [%s]", file, exc)
self.logger.error("Failed to remove file %s [%s]", file, exc)

def save(self, dataframe:pd.DataFrame, file_name:str) -> None:
"""
save dataframe to the file name
"""
self.logger.info(f"saving data to {file_name}")
self.logger.info(f"Saving data to {file_name}")
dataframe.to_csv(file_name)
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def update_ports_data(self):
for port in meta_data:
port_name = port.get(Constants.PORT_NAME)
if not self.ports_data.get(port_name):
self.ports_data[port_name] = {}
self.ports_data[port_name] = PortData(port_name)
self.update_port_metadata(port_name, port)
ports_updated = True
return ports_updated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,13 @@ def check_link_down_issue(self, port_obj, row, timestamp, ports_counters):
return None
peer_link_downed_rate = self.get_rate(peer_obj, Constants.LNK_DOWNED_COUNTER, peer_link_downed, peer_row_timestamp)
if peer_link_downed_rate > 0:
self.logger.info(f"Isolation issue ({Constants.ISSUE_LINK_DOWN}) detected for port {port_obj.port_name}: "
f"link down counter raised from {old_link_downed} to {link_downed} "
f"and its peer ({port_obj.peer}) link down rate is {peer_link_downed_rate}")
info_msg = ""
if link_downed == old_link_downed:
info_msg += f"link down counter is {link_downed} with link down rate {link_downed_rate} "
else:
info_msg += f"link down counter raised from {old_link_downed} to {link_downed} "
info_msg += f"and its peer ({port_obj.peer}) link down rate is {peer_link_downed_rate}"
self.logger.info(f"Isolation issue ({Constants.ISSUE_LINK_DOWN}) detected for port {port_obj.port_name}: {info_msg}")
return Issue(port_obj.port_name, Constants.ISSUE_LINK_DOWN)
return None

Expand Down