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 c20ded1c..8abe2138 100755 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzer.py @@ -354,7 +354,8 @@ def create_analyzer(parsed_args, full_extracted_logs_list, LINK_FLAPPING = str(links_flapping_analyzer.get_link_flapping_last_week() \ if links_flapping_analyzer else "No link flapping info") # PDF creator gets all the images and to add to the report - TEXT = text + os.linesep + FABRIC_INFO + os.linesep + "Link Flapping:" + os.linesep + LINK_FLAPPING + TEXT = text + os.linesep + FABRIC_INFO + os.linesep + \ + "Link Flapping:" + os.linesep + LINK_FLAPPING pdf = PDFCreator(pdf_path, pdf_header, png_images, TEXT) pdf.created_pdf() # Generated a report that can be located in the destination diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/console_log_analyzer.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/console_log_analyzer.py index b709bd59..11aeb3a7 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/console_log_analyzer.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_analyzers/console_log_analyzer.py @@ -38,7 +38,14 @@ def _extract_ufm_version(logs_csvs): temp_file = csv_file + ".temp" # Open the input CSV file for reading - with open(csv_file, mode='r', newline='') as infile, open(temp_file, mode='w', newline='') as outfile: + with open(csv_file, + mode='r', + newline='', + encoding=DataConstants.UTF8ENCODING) as infile, \ + open(temp_file, + mode='w', + newline='', + encoding=DataConstants.UTF8ENCODING) as outfile: reader = csv.DictReader(infile) fieldnames = reader.fieldnames # Get the header from the CSV writer = csv.DictWriter(outfile, fieldnames=fieldnames) @@ -49,7 +56,8 @@ def _extract_ufm_version(logs_csvs): # Iterate through each row in the input CSV for row in reader: if row['type'] == 'ufm_version': - # If the type is 'ufm_version', save the row and don't write it to the new file + # If the type is 'ufm_version', + # save the row and don't write it to the new file ufm_versions.add(row['data']) else: # Write the row to the new CSV file diff --git a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_parsing/console_log_regex.py b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_parsing/console_log_regex.py index ddee9582..315ac3ee 100644 --- a/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_parsing/console_log_regex.py +++ b/plugins/ufm_log_analyzer_plugin/src/loganalyze/log_parsing/console_log_regex.py @@ -43,8 +43,8 @@ ) def ufm_version(match: Match): - ufm_version = match.group() - return (None, "ufm_version", ufm_version) + ufm_version_text = match.group() + return (None, "ufm_version", ufm_version_text) def console_log_exception(match: Match): timestamp = match.group(1)