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 2049130f..92e8f0be 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc @@ -3,4 +3,4 @@ disable=missing-function-docstring, missing-class-docstring, missing-module-docstring, too-few-public-methods, - logging-fstring-interpolation + logging-fstring-interpolation, 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..1cdece7b 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,13 @@ def create_analyzer(parsed_args, full_extracted_logs_list, "secondary_", 1000, "gz") - links_flapping_analyzer = LinkFlappingAnalyzer(second_telemetry_samples, + if len(second_telemetry_samples): + + 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 # pylint: disable=invalid-name end = time.perf_counter() log.LOGGER.debug(f"Took {end-start:.3f} to load the parsed data") @@ -350,10 +354,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 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: