Skip to content

Commit

Permalink
readds check if last element is available on line
Browse files Browse the repository at this point in the history
  • Loading branch information
gurubert committed Oct 11, 2024
1 parent 0b6a51f commit e97afec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ def parse_postfix_mailq_details(string_table):
section = {}
for line in string_table:
item = _postfix_mailq_details_name(line)
mails = int(line[3])
try:
bytes = int(line[4])
except:
bytes = 0
if line[1] == 'age':
data = (line[2], int(line[3]), int(line[4]))
data = (line[2], mails, bytes)
if line[1] == 'total' and line[2] == 'all':
data = (line[5], int(line[3]), int(line[4]))
data = (line[5], mails, bytes)
section[item] = data
return section

Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit e97afec

Please sign in to comment.