Skip to content

Commit

Permalink
Issue 32 (#33)
Browse files Browse the repository at this point in the history
* [issue_32] Fix issue where a host/service var is not a string. Only quote if the instance is str.

* Update all dependency
  • Loading branch information
thenodon authored Apr 17, 2022
1 parent 400bc3c commit 853a1e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions icinga2_exporter/perfdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 853a1e0

Please sign in to comment.