From e88883566276a320288c6986fb88d85547eead86 Mon Sep 17 00:00:00 2001 From: Sean Corrigan Date: Fri, 5 Nov 2021 12:20:39 -0400 Subject: [PATCH] Patched offline ups error --- main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 89ede86..f9137a0 100644 --- a/main.py +++ b/main.py @@ -43,10 +43,13 @@ def main(): ## pull all the UPSes froom each host into a nice dict for host in hostList: - upslist[host] = [] - client = PyNUTClient(host, '3493') - for UPS in client.list_ups(): - upslist[host].append(UPS) + try: + upslist[host] = [] + client = PyNUTClient(host, '3493') + for UPS in client.list_ups(): + upslist[host].append(UPS) + except: + print('UPS {} is having issues'.format(host)) # print(upslist)