From 84607d5399ca228547d565147ba1f0536735f375 Mon Sep 17 00:00:00 2001 From: osiu97 Date: Wed, 23 Oct 2019 08:18:50 +0200 Subject: [PATCH] Added Exception to work with offline hosts in cluster --- PVEApi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVEApi.py b/PVEApi.py index fa5afa6..5363c1d 100755 --- a/PVEApi.py +++ b/PVEApi.py @@ -73,7 +73,10 @@ class PVEApi(object): vmlist = list() for node in nodelist: url = self.url + '/nodes/' + node.name + '/qemu' - response = json.load(urllib2.urlopen(self.get_request(url), context=ssl._create_unverified_context())) + try: + response = json.load(urllib2.urlopen(self.get_request(url), context=ssl._create_unverified_context())) + except Exception as e: + passs resources = response['data'] for machine in resources: name = machine[u'name']