|
4 | 4 |
|
5 | 5 | import itertools |
6 | 6 | import logging |
7 | | -import os |
8 | 7 | import tempfile |
9 | 8 |
|
10 | 9 | import git |
11 | 10 | from packaging import version |
12 | 11 |
|
13 | 12 | import lib.config as global_config |
14 | 13 | from lib import pxe |
15 | | -from lib import commands |
16 | 14 | from lib.common import ( |
17 | | - callable_marker, |
18 | 15 | DiskDevName, |
19 | 16 | HostAddress, |
| 17 | + callable_marker, |
20 | 18 | is_uuid, |
21 | 19 | prefix_object_name, |
22 | | - setup_formatted_and_mounted_disk, |
23 | 20 | shortened_nodeid, |
24 | | - teardown_formatted_and_mounted_disk, |
25 | 21 | vm_image, |
26 | 22 | wait_for, |
27 | 23 | ) |
|
35 | 31 | # Import package-scoped fixtures. Although we need to define them in a separate file so that we can |
36 | 32 | # then import them in individual packages to fix the buggy package scope handling by pytest, we also |
37 | 33 | # need to import them in the global conftest.py so that they are recognized as fixtures. |
38 | | -from pkgfixtures import formatted_and_mounted_ext4_disk, sr_disk_wiped |
| 34 | +# Linters might be confused by that and see these imports as unused. The `noqa` suppresses the |
| 35 | +# false-positive warnings. |
| 36 | +from pkgfixtures import formatted_and_mounted_ext4_disk, sr_disk_wiped # noqa |
39 | 37 |
|
40 | 38 | from typing import Dict, Generator, Iterable |
41 | 39 |
|
@@ -321,7 +319,7 @@ def xfail_on_xcpng_8_3(host, request): |
321 | 319 | @pytest.fixture(scope='session') |
322 | 320 | def host_no_ipv6(host): |
323 | 321 | if is_ipv6(host.hostname_or_ip): |
324 | | - pytest.skip(f"This test requires an IPv4 XCP-ng") |
| 322 | + pytest.skip("This test requires an IPv4 XCP-ng") |
325 | 323 |
|
326 | 324 | @pytest.fixture(scope="session") |
327 | 325 | def shared_sr(host): |
@@ -442,9 +440,7 @@ def vm_ref(request): |
442 | 440 | logging.info(">> No VM specified on CLI, and no default found in test definition. Using global default.") |
443 | 441 | ref = 'mini-linux-x86_64-bios' |
444 | 442 |
|
445 | | - if is_uuid(ref): |
446 | | - return ref |
447 | | - elif ref.startswith('http'): |
| 443 | + if is_uuid(ref) or ref.startswith('http'): |
448 | 444 | return ref |
449 | 445 | else: |
450 | 446 | return vm_image(ref) |
|
0 commit comments