From 617355fa099766e5105828e1715d3a10774bdb5d Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:26:26 +0300 Subject: [PATCH 1/9] fix when no samples --- .../src/loganalyze/log_analyzer.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py index ac36f638..adfae995 100755 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py @@ -280,7 +280,7 @@ def create_analyzer(parsed_args, full_extracted_logs_list, ) if len(failed_extract) > 0: - log.LOGGER.warning(f"Failed to get some logs - {failed_extract}, skipping them") + log.LOGGER.debug(f"Failed to get some logs - {failed_extract}, skipping them") logs_regex_csv_handler_list = create_logs_regex_csv_handler_list( logs_to_work_with ) @@ -325,9 +325,12 @@ def create_analyzer(parsed_args, full_extracted_logs_list, "secondary_", 1000, "gz") - links_flapping_analyzer = LinkFlappingAnalyzer(second_telemetry_samples, + if len(second_telemetry_samples) > 0: + links_flapping_analyzer = LinkFlappingAnalyzer(second_telemetry_samples, args.destination) - ufm_top_analyzer.add_analyzer(links_flapping_analyzer) + ufm_top_analyzer.add_analyzer(links_flapping_analyzer) + else: + links_flapping_analyzer = None end = time.perf_counter() log.LOGGER.debug(f"Took {end-start:.3f} to load the parsed data") @@ -350,10 +353,11 @@ def create_analyzer(parsed_args, full_extracted_logs_list, text_to_show_in_pdf = f"Used ufm version in console log {used_ufm_version}" fabric_info = "fabric info:" + os.linesep + str(ibdiagnet_analyzer.get_fabric_size()) \ if ibdiagnet_analyzer else "No Fabric Info found" # pylint: disable=invalid-name - link_flapping = links_flapping_analyzer.get_link_flapping_last_week() \ + if links_flapping_analyzer: + link_flapping = links_flapping_analyzer.get_link_flapping_last_week() \ if links_flapping_analyzer else "No link flapping info" - text_to_show_in_pdf += os.linesep + str(fabric_info) + os.linesep + \ - "Link Flapping:" + os.linesep + str(link_flapping) + text_to_show_in_pdf += os.linesep + str(fabric_info) + os.linesep + \ + "Link Flapping:" + os.linesep + str(link_flapping) critical_events_burst = event_log_analyzer.get_critical_event_bursts() critical_events_text = "The minute event_type event count" # pylint: disable=invalid-name From 88b95fc70254b5034fbb4ddb4a848ff7e184cc7f Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:32:42 +0300 Subject: [PATCH 2/9] pylint --- plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py | 2 +- .../src/loganalyze/log_analyzers/base_analyzer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py index adfae995..0f7ee686 100755 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py @@ -330,7 +330,7 @@ def create_analyzer(parsed_args, full_extracted_logs_list, args.destination) ufm_top_analyzer.add_analyzer(links_flapping_analyzer) else: - links_flapping_analyzer = None + links_flapping_analyzer = None # pylint: disable=invalid-name end = time.perf_counter() log.LOGGER.debug(f"Took {end-start:.3f} to load the parsed data") diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/base_analyzer.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/base_analyzer.py index 005e3cb7..ecffb517 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/base_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/base_analyzer.py @@ -94,7 +94,7 @@ def _save_data_based_on_timestamp( self._images_created.extend(images_list_with_title) plt.close() - def _save_pivot_data_in_bars( # pylint: disable=# pylint: disable=too-many-arguments + def _save_pivot_data_in_bars( # pylint: disable=too-many-arguments self, pivoted_data, x_label, y_label, title, legend_title ): if pivoted_data.empty: From 5534db08206544e3058a60f291c78a8652267274 Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:34:24 +0300 Subject: [PATCH 3/9] pylint2 --- plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc index 2049130f..11932cb4 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -3,4 +3,5 @@ disable=missing-function-docstring, missing-class-docstring, missing-module-docstring, too-few-public-methods, - logging-fstring-interpolation + logging-fstring-interpolation, + invalid-name From 14dc7ef08f3102901a9455a91aab8cfab2ab5448 Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:36:53 +0300 Subject: [PATCH 4/9] pylint3 --- plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc index 11932cb4..38b6c249 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -5,3 +5,6 @@ disable=missing-function-docstring, too-few-public-methods, logging-fstring-interpolation, invalid-name + +[FORMAT] +max-args=8 \ No newline at end of file From e9be150593b5892ae1016450038ba2dd54faca02 Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:39:16 +0300 Subject: [PATCH 5/9] pylint4 --- plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc index 38b6c249..c1ef3539 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -5,6 +5,4 @@ disable=missing-function-docstring, too-few-public-methods, logging-fstring-interpolation, invalid-name - -[FORMAT] max-args=8 \ No newline at end of file From 0239d102cb78570f6fb726f482fab30b1ee8d33f Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:41:07 +0300 Subject: [PATCH 6/9] pylint5 --- plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc index c1ef3539..c5211484 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -5,4 +5,6 @@ disable=missing-function-docstring, too-few-public-methods, logging-fstring-interpolation, invalid-name + +[DESIGN] max-args=8 \ No newline at end of file From 500ddecc7dfc02ec14737e4bf3a2f6f7fe285cf4 Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:44:48 +0300 Subject: [PATCH 7/9] pylint666 --- .github/workflows/ufm_log_analyzer_ci_workflow.yml | 2 +- plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ufm_log_analyzer_ci_workflow.yml b/.github/workflows/ufm_log_analyzer_ci_workflow.yml index cdcc09a4..9311ee4d 100644 --- a/.github/workflows/ufm_log_analyzer_ci_workflow.yml +++ b/.github/workflows/ufm_log_analyzer_ci_workflow.yml @@ -30,7 +30,7 @@ jobs: # Install dependencies pip install -r src/loganalyze/requirements.txt - pip install pylint + pip install pylint==3.2.6 # Run PyLint pylint --rcfile=src/loganalyze/.pylintrc src/loganalyze diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc index c5211484..11932cb4 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -5,6 +5,3 @@ disable=missing-function-docstring, too-few-public-methods, logging-fstring-interpolation, invalid-name - -[DESIGN] -max-args=8 \ No newline at end of file From 6142716fca8b5ab58e47a059937ad4113dbc8913 Mon Sep 17 00:00:00 2001 From: Boaz Haim Date: Tue, 24 Sep 2024 08:46:10 +0300 Subject: [PATCH 8/9] pylint667 --- plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc index 11932cb4..92e8f0be 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -4,4 +4,3 @@ disable=missing-function-docstring, missing-module-docstring, too-few-public-methods, logging-fstring-interpolation, - invalid-name From ead3107d5f5bd765632d669e3e114751ad4767fe Mon Sep 17 00:00:00 2001 From: boazhaim <160493207+boazhaim@users.noreply.github.com> Date: Tue, 24 Sep 2024 08:57:28 +0300 Subject: [PATCH 9/9] Update plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py Co-authored-by: shmufeld <97442151+shmufeld@users.noreply.github.com> --- plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py index 0f7ee686..1cdece7b 100755 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py @@ -325,7 +325,8 @@ def create_analyzer(parsed_args, full_extracted_logs_list, "secondary_", 1000, "gz") - if len(second_telemetry_samples) > 0: + if len(second_telemetry_samples): + links_flapping_analyzer = LinkFlappingAnalyzer(second_telemetry_samples, args.destination) ufm_top_analyzer.add_analyzer(links_flapping_analyzer)