Skip to content

Commit

Permalink
catch JSONDecodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
nedjitef committed Mar 13, 2023
1 parent 863b732 commit 3a473fe
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions agent_based/proxmox_bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,12 @@ def proxmox_bs_checks(item, params, section):
if "upid" in gc:
upid = gc["upid"]
if (n == "proxmox-backup-client list") and (k == item):
for e in json.loads(c):
group_count=group_count+1
total_backups=total_backups+int(e["backup-count"])
try:
for e in json.loads(c):
group_count = group_count+1
total_backups = total_backups+int(e["backup-count"])
except json.JSONDecodeError:
pass
if (n == "proxmox-backup-client snapshot list") and (k == item):
nr, np, ok, nok = 0, [], 0, []
try:
Expand Down

0 comments on commit 3a473fe

Please sign in to comment.