From 673e01bd03ab4ed85a378ffbc9cf303e043224b6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ky=C3=A2ne?= <kyane@kyane.fr>
Date: Wed, 11 Nov 2020 19:25:27 +0100
Subject: [PATCH] Support vmagent that doesn't return x-influxdb-version header

---
 main.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/main.py b/main.py
index 805b3a5..e02bf9e 100755
--- a/main.py
+++ b/main.py
@@ -71,6 +71,10 @@ def influxb_connect(config):
             )
         client.ping()
         return client
+    except KeyError as e:
+        if e.args == ("x-influxdb-version",):
+            print("Ignoring vmagent missing x-influxdb-version header")
+        return client
     except Exception as e:
         print("Cannot connect to {} : {}".format(o.hostname, e))
         print("If InfluxDB has just started, this is normal, please wait!")
-- 
GitLab