daemon: finished class variable type hinting for core.nodes

This commit is contained in:
Blake Harnden 2020-06-10 08:52:51 -07:00
parent 452e0720f2
commit 6ee9590bdc
4 changed files with 15 additions and 15 deletions

View file

@ -3,7 +3,7 @@ import logging
import os
import time
from tempfile import NamedTemporaryFile
from typing import TYPE_CHECKING, Callable, Dict
from typing import TYPE_CHECKING, Callable, Dict, Optional
from core import utils
from core.emulator.distributed import DistributedServer
@ -18,10 +18,10 @@ if TYPE_CHECKING:
class LxdClient:
def __init__(self, name: str, image: str, run: Callable[..., str]) -> None:
self.name = name
self.image = image
self.run = run
self.pid = None
self.name: str = name
self.image: str = image
self.run: Callable[..., str] = run
self.pid: Optional[int] = None
def create_container(self) -> int:
self.run(f"lxc launch {self.image} {self.name}")
@ -92,7 +92,7 @@ class LxcNode(CoreNode):
"""
if image is None:
image = "ubuntu"
self.image = image
self.image: str = image
super().__init__(session, _id, name, nodedir, start, server)
def alive(self) -> bool: