From c77b07435ed2a8105d03de617f3235eb09c17a16 Mon Sep 17 00:00:00 2001 From: vg12345 <77556137+vg12345@users.noreply.github.com> Date: Mon, 30 Sep 2024 12:55:21 +0300 Subject: [PATCH] issue:4094251 PDR plugin resetting port: Expected status code is 202, not 200 (#263) --- .../ufm_sim_web_service/isolation_mgr.py | 5 +++-- .../ufm_sim_web_service/pdr_algorithm.py | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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 689ffe08..51a9ca1b 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 @@ -136,7 +136,7 @@ def reset_port(self, port_name, port_guid): # Perform reset ret = self.ufm_client.reset_port(port_name, port_guid) - if not ret or ret.status_code != http.HTTPStatus.OK: + if not ret or ret.status_code != http.HTTPStatus.ACCEPTED: self.logger.warning("Failed resetting port: %s... status_code= %s", port_name, ret.status_code) return @@ -338,9 +338,10 @@ def main_flow(self): self.logger.error("Couldn't retrieve telemetry data") else: # Detect ports to be isolated or deisolated + self.logger.info("Starting telemetry data analysis") issues = self.pdr_alg.analyze_telemetry_data(self.ports_data, ports_counters) except (KeyError, TypeError, ValueError) as exception_error: - self.logger.error(f"failed to read information with error {exception_error}") + self.logger.error(f"Failed to read information with error {exception_error}") # deal with reported new issues for issue in issues or []: 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 f18e9e7f..b6c0b011 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 @@ -24,7 +24,7 @@ class PortData: """ Represents the port data. """ - #pylint: disable=too-many-arguments + #pylint: disable=too-many-positional-arguments,too-many-arguments def __init__(self, port_name=None, port_num=None, peer=None, node_type=None, active_speed=None, port_width=None, port_guid=None): """ Initialize a new instance of the PortData class. @@ -470,7 +470,7 @@ def check_deisolation_conditions(self, isolated_port): return True - #pylint: disable=too-many-arguments,too-many-locals + #pylint: disable=too-many-positional-arguments,too-many-arguments,too-many-locals def calc_symbol_ber_rate(self, port_name, port_speed, port_width, col_name, time_delta): """ calculate the symbol BER rate for a given port given the time delta