mirror of
https://github.com/thegeeklab/prometheus-pve-sd.git
synced 2024-06-01 23:49:40 +02:00
Yapf/flake8
This commit is contained in:
parent
7faf4561a5
commit
3933c73f3c
|
@ -98,7 +98,9 @@ class Discovery():
|
|||
sources = [config["net0"]]
|
||||
|
||||
for s in sources:
|
||||
find = re.search(r"ip=(([a-fA-F0-9]{0,4}:{0,2}){0,7}:[0-9a-fA-F]{1,4})", str(s))
|
||||
find = re.search(
|
||||
r"ip=(([a-fA-F0-9]{0,4}:{0,2}){0,7}:[0-9a-fA-F]{1,4})", str(s)
|
||||
)
|
||||
if find and find.group(1):
|
||||
ipv6_address = find.group(1)
|
||||
break
|
||||
|
|
15
prometheuspvesd/test/fixtures/fixtures.py
vendored
15
prometheuspvesd/test/fixtures/fixtures.py
vendored
|
@ -243,11 +243,16 @@ def qemus():
|
|||
@pytest.fixture
|
||||
def instance_config():
|
||||
return {
|
||||
"name": "102.example.com",
|
||||
"description": "{\"groups\": \"test-group\"}",
|
||||
"net0": "virtio=D8-85-75-47-2E-8D,bridge=vmbr122,ip=192.0.2.25,ip=2001:db8:3333:4444:5555:6666:7777:8888",
|
||||
"cpu": 2,
|
||||
"cores": 2
|
||||
"name":
|
||||
"102.example.com",
|
||||
"description":
|
||||
'{"groups": "test-group"}',
|
||||
"net0":
|
||||
"virtio=D8-85-75-47-2E-8D,bridge=vmbr122,ip=192.0.2.25,ip=2001:db8::6666:7777:8888",
|
||||
"cpu":
|
||||
2,
|
||||
"cores":
|
||||
2
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ def test_get_ip_addresses_from_instance_config(mocker, discovery, instance_confi
|
|||
|
||||
assert discovery._get_ip_addresses("qemu", "dummy", "dummy") == (
|
||||
"192.0.2.25",
|
||||
"2001:db8:3333:4444:5555:6666:7777:8888",
|
||||
"2001:db8::6666:7777:8888",
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user