Skip to content

Commit 0c6c08c

Browse files
committed
host: explicitly type Host.pool
For some reason pyright would not consider the type known otherwise. Also use unquoted type hint, since we have deferred annotations and we use it that way in all other places. Signed-off-by: Yann Dirson <[email protected]>
1 parent f5f081a commit 0c6c08c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/host.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import lib.commands as commands
1414
import lib.pif as pif
1515
if TYPE_CHECKING:
16-
import lib.pool
16+
from lib.pool import Pool
1717

1818
from lib.common import DiskDevName
1919
from lib.common import _param_add, _param_clear, _param_get, _param_remove, _param_set, strtobool
@@ -39,8 +39,9 @@ def host_data(hostname_or_ip):
3939

4040
class Host:
4141
xe_prefix = "host"
42+
pool: Pool
4243

43-
def __init__(self, pool: 'lib.pool.Pool', hostname_or_ip):
44+
def __init__(self, pool: Pool, hostname_or_ip):
4445
self.pool = pool
4546
self.hostname_or_ip = hostname_or_ip
4647
self.xo_srv_id: Optional[str] = None

0 commit comments

Comments
 (0)