Skip to content

Commit 72d1957

Browse files
committed
fix I001 unsorted-imports
Signed-off-by: Gaëtan Lehmann <[email protected]>
1 parent 5020e47 commit 72d1957

File tree

125 files changed

+268
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+268
-121
lines changed

conftest.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
11
import itertools
2-
import git
32
import logging
43
import os
5-
import pytest
64
import tempfile
5+
from typing import Dict
76

7+
import git
8+
import pytest
89
from packaging import version
9-
from typing import Dict
1010

1111
import lib.config as global_config
12-
1312
from lib import pxe
14-
from lib.common import callable_marker, shortened_nodeid, prefix_object_name
15-
from lib.common import wait_for, vm_image, is_uuid
16-
from lib.common import setup_formatted_and_mounted_disk, teardown_formatted_and_mounted_disk
13+
from lib.common import (
14+
callable_marker,
15+
is_uuid,
16+
prefix_object_name,
17+
setup_formatted_and_mounted_disk,
18+
shortened_nodeid,
19+
teardown_formatted_and_mounted_disk,
20+
vm_image,
21+
wait_for,
22+
)
1723
from lib.netutil import is_ipv6
1824
from lib.pool import Pool
1925
from lib.sr import SR

jobs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import json
55
import subprocess
66
import sys
7+
78
from lib.commands import ssh
89

910
JOBS = {

lib/basevm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import logging
2-
3-
from typing import Any, Literal, Optional, overload, TYPE_CHECKING
2+
from typing import TYPE_CHECKING, Any, Literal, Optional, overload
43

54
import lib.commands as commands
5+
66
if TYPE_CHECKING:
77
import lib.host
88

lib/commands.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
import logging
33
import shlex
44
import subprocess
5-
from typing import List, Literal, overload, Union
6-
5+
from typing import List, Literal, Union, overload
76

87
import lib.config as config
98
from lib.netutil import wrap_ip
109

11-
1210
class BaseCommandFailed(Exception):
1311
__slots__ = 'returncode', 'stdout', 'cmd'
1412

lib/common.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
import time
88
import traceback
99
from enum import Enum
10-
from typing import Callable, cast, Dict, Literal, Optional, overload, TYPE_CHECKING, TypeVar, Union
10+
from typing import TYPE_CHECKING, Callable, Dict, Literal, Optional, TypeVar, Union, cast, overload
1111
from uuid import UUID
1212

1313
import pytest
1414
import requests
1515

1616
import lib.commands as commands
17+
1718
if TYPE_CHECKING:
1819
import lib.host
1920

@@ -26,7 +27,7 @@ class PackageManagerEnum(Enum):
2627

2728
# Common VM images used in tests
2829
def vm_image(vm_key):
29-
from data import VM_IMAGES, DEF_VM_URL
30+
from data import DEF_VM_URL, VM_IMAGES
3031
url = VM_IMAGES[vm_key]
3132
if not url.startswith('http'):
3233
url = DEF_VM_URL + url

lib/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
ssh_output_max_lines = 20
33

44
def sr_device_config(datakey, *, required=[]):
5-
import data # import here to avoid depending on this user file for collecting tests
5+
import data # import here to avoid depending on this user file for collecting tests
66
config = getattr(data, datakey)
77
for required_field in required:
88
if required_field not in config:

lib/efi.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import lib.commands as commands
2121

22-
2322
class GUID(UUID):
2423
def as_bytes(self):
2524
return self.bytes_le

lib/host.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,30 @@
66
import subprocess
77
import tempfile
88
import uuid
9+
from typing import TYPE_CHECKING, Dict, List, Literal, Optional, Union, overload
910

1011
from packaging import version
11-
from typing import Dict, List, Literal, Optional, overload, TYPE_CHECKING, Union
1212

1313
import lib.commands as commands
1414
import lib.pif as pif
15+
1516
if TYPE_CHECKING:
1617
import lib.pool
1718

18-
from lib.common import _param_add, _param_clear, _param_get, _param_remove, _param_set, strtobool
19-
from lib.common import safe_split, strip_suffix, to_xapi_bool, wait_for, wait_for_not
20-
from lib.common import prefix_object_name
19+
from lib.common import (
20+
_param_add,
21+
_param_clear,
22+
_param_get,
23+
_param_remove,
24+
_param_set,
25+
prefix_object_name,
26+
safe_split,
27+
strip_suffix,
28+
strtobool,
29+
to_xapi_bool,
30+
wait_for,
31+
wait_for_not,
32+
)
2133
from lib.netutil import wrap_ip
2234
from lib.sr import SR
2335
from lib.vdi import VDI
@@ -29,7 +41,7 @@
2941

3042
def host_data(hostname_or_ip):
3143
# read from data.py
32-
from data import HOST_DEFAULT_USER, HOST_DEFAULT_PASSWORD, HOSTS
44+
from data import HOST_DEFAULT_PASSWORD, HOST_DEFAULT_USER, HOSTS
3345
if hostname_or_ip in HOSTS:
3446
h_data = HOSTS[hostname_or_ip]
3547
return h_data

lib/installer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import time
33
import xml.etree.ElementTree as ET
44

5-
from lib.commands import ssh, SSHCommandFailed
5+
from lib.commands import SSHCommandFailed, ssh
66
from lib.common import wait_for
77

88
class AnswerFile:

lib/pif.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import lib.commands as commands
2-
32
from lib.common import _param_add, _param_clear, _param_get, _param_remove, _param_set
43

54
class PIF:

0 commit comments

Comments
 (0)