Skip to content

Commit 3a473fe

Browse files
committed
catch JSONDecodeError
1 parent 863b732 commit 3a473fe

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

agent_based/proxmox_bs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ def proxmox_bs_checks(item, params, section):
130130
if "upid" in gc:
131131
upid = gc["upid"]
132132
if (n == "proxmox-backup-client list") and (k == item):
133-
for e in json.loads(c):
134-
group_count=group_count+1
135-
total_backups=total_backups+int(e["backup-count"])
133+
try:
134+
for e in json.loads(c):
135+
group_count = group_count+1
136+
total_backups = total_backups+int(e["backup-count"])
137+
except json.JSONDecodeError:
138+
pass
136139
if (n == "proxmox-backup-client snapshot list") and (k == item):
137140
nr, np, ok, nok = 0, [], 0, []
138141
try:

0 commit comments

Comments
 (0)