mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-06-02 16:09:41 +02:00
yapf
This commit is contained in:
parent
dbf558cc1d
commit
cb003a641e
|
@ -157,8 +157,9 @@ class Discovery():
|
|||
if str(obj["vmid"]) in self.config.config["exclude_vmid"]:
|
||||
continue
|
||||
|
||||
if isinstance(obj["tags"], str) and not set(obj["tags"].split(",")).isdisjoint(
|
||||
self.config.config["exclude_tags"]
|
||||
if (
|
||||
isinstance(obj["tags"], str)
|
||||
and not set(obj["tags"].split(",")).isdisjoint(self.config.config["exclude_tags"])
|
||||
):
|
||||
continue
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ def test_exclude_vmid(discovery_fixture, qemus):
|
|||
assert filtered == expected
|
||||
discovery_fixture.config.config["exclude_vmid"] = []
|
||||
|
||||
|
||||
def test_exclude_state(discovery_fixture, qemus):
|
||||
discovery_fixture.config.config["exclude_state"] = ["prelaunch"]
|
||||
filtered = discovery_fixture._exclude(qemus)
|
||||
|
@ -33,6 +34,7 @@ def test_exclude_state(discovery_fixture, qemus):
|
|||
assert len(filtered) == 2
|
||||
discovery_fixture.config.config["exclude_state"] = []
|
||||
|
||||
|
||||
def test_exclude_tags(discovery_fixture, qemus):
|
||||
discovery_fixture.config.config["exclude_tags"] = ["unmonitored"]
|
||||
|
||||
|
@ -41,6 +43,7 @@ def test_exclude_tags(discovery_fixture, qemus):
|
|||
assert len(filtered) == 2
|
||||
discovery_fixture.config.config["exclude_tags"] = []
|
||||
|
||||
|
||||
def test_validate_ip(discovery_fixture, addresses):
|
||||
# IPv4 validation
|
||||
for address in addresses["ipv4_valid"]:
|
||||
|
|
Loading…
Reference in New Issue
Block a user