fix: convert list items to strings before exclude check is performed

This commit is contained in:
Robert Kaussow 2021-06-13 16:09:27 +02:00
parent 75cfc01e80
commit b8f82976b5
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
2 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ class Config():
},
"exclude_vmid": {
"default": [],
"env": "EXCLUDE_STATE",
"env": "EXCLUDE_VMID",
"file": True,
"type": environs.Env().list
},

View File

@ -124,10 +124,10 @@ class Discovery():
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())