From 58927177294cb204e53d1916645ab6eba9c6f4f6 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 13 Jun 2021 17:34:30 +0200 Subject: [PATCH] fix: convert list items to strings before exclude check is performed (#9) --- prometheuspvesd/config.py | 2 +- prometheuspvesd/discovery.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/prometheuspvesd/config.py b/prometheuspvesd/config.py index f72d0d5..0b8aff5 100644 --- a/prometheuspvesd/config.py +++ b/prometheuspvesd/config.py @@ -75,7 +75,7 @@ class Config(): }, "exclude_vmid": { "default": [], - "env": "EXCLUDE_STATE", + "env": "EXCLUDE_VMID", "file": True, "type": environs.Env().list }, diff --git a/prometheuspvesd/discovery.py b/prometheuspvesd/discovery.py index f3c8555..52f86be 100644 --- a/prometheuspvesd/discovery.py +++ b/prometheuspvesd/discovery.py @@ -124,10 +124,10 @@ def _exclude(self, pve_list): if obj["template"] == 1: continue - if obj["status"] in self.config.config["exclude_state"]: + if obj["status"] in map(str, self.config.config["exclude_state"]): continue - if obj["vmid"] in self.config.config["exclude_vmid"]: + if obj["vmid"] in map(str, self.config.config["exclude_vmid"]): continue filtered.append(item.copy())