Skip to content

Commit

Permalink
pylint
Browse files Browse the repository at this point in the history
  • Loading branch information
boazhaim committed Sep 11, 2024
1 parent 96ed277 commit c5c2487
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c5c2487

Please sign in to comment.