diff --git a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/data_store.py b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/data_store.py index dba03a07..edaa3e3c 100644 --- a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/data_store.py +++ b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/data_store.py @@ -71,7 +71,7 @@ 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): @@ -79,11 +79,11 @@ def _remove_files(self, files: list) -> None: 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) 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 51a9ca1b..e8fd3cc8 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 @@ -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 diff --git a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/pdr_algorithm.py b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/pdr_algorithm.py index b6c0b011..0a46561e 100644 --- a/plugins/pdr_deterministic_plugin/ufm_sim_web_service/pdr_algorithm.py +++ b/plugins/pdr_deterministic_plugin/ufm_sim_web_service/pdr_algorithm.py @@ -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