From 36f8ef785b67bda212931cf2faf11300f7911a32 Mon Sep 17 00:00:00 2001 From: beylisstan <37801987+beylisstan@users.noreply.github.com> Date: Thu, 17 May 2018 13:49:14 +0300 Subject: [PATCH] Update libvirt_exporter.py function connect_to_uri modified with try except statement --- libvirt_exporter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libvirt_exporter.py b/libvirt_exporter.py index 6a56afd..9cd476c 100644 --- a/libvirt_exporter.py +++ b/libvirt_exporter.py @@ -16,7 +16,12 @@ def connect_to_uri(uri): - conn = libvirt.open(uri) + + conn = None + try: + conn = libvirt.open(uri) + except: + pass if conn == None: print('Failed to open connection to ' + uri, file = sys.stderr)