From 853a1e036ed5617fb81a2778df8a91b7631bdc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20H=C3=A5=C3=A5l?= Date: Sun, 17 Apr 2022 09:14:12 +0200 Subject: [PATCH] Issue 32 (#33) * [issue_32] Fix issue where a host/service var is not a string. Only quote if the instance is str. * Update all dependency --- icinga2_exporter/perfdata.py | 4 ++-- requirements.txt | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/icinga2_exporter/perfdata.py b/icinga2_exporter/perfdata.py index c55fd47..aaf2037 100644 --- a/icinga2_exporter/perfdata.py +++ b/icinga2_exporter/perfdata.py @@ -387,8 +387,8 @@ def get_host_meta_custom_vars(host_attrs): @staticmethod def valid_prometheus_label_values(value: str) -> str: - # Quote backslash - if '\\' in value: + # Quote backslash if it's a str + if isinstance(value, str) and '\\' in value: value = value.replace('\\', '\\\\') return value diff --git a/requirements.txt b/requirements.txt index 046cd0a..235d3b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -aiohttp==3.7.4.post0 +aiohttp==3.8.1 asyncio==3.4.3 -prometheus-client==0.11.0 -python-json-logger==2.0.1 -PyYAML==5.4.1 -Quart==0.15.1 -requests==2.26.0 +prometheus-client==0.14.1 +python-json-logger==2.0.2 +PyYAML==6.0 +Quart==0.17.0 +requests==2.27.1