3
0
Fork 0
forked from mirrors/nixpkgs

nixos/lib/test-driver: set defaults in __init__ instead of class level

Just a minor code style nit to avoid potential footguns
This commit is contained in:
K900 2021-10-19 16:29:19 +03:00
parent a874235dff
commit 9611041ef5

View file

@ -405,14 +405,14 @@ class Machine:
keep_vm_state: bool
allow_reboot: bool
process: Optional[subprocess.Popen] = None
pid: Optional[int] = None
monitor: Optional[socket.socket] = None
shell: Optional[socket.socket] = None
process: Optional[subprocess.Popen]
pid: Optional[int]
monitor: Optional[socket.socket]
shell: Optional[socket.socket]
serial_thread: Optional[threading.Thread]
booted: bool = False
connected: bool = False
booted: bool
connected: bool
# Store last serial console lines for use
# of wait_for_console_text
last_lines: Queue = Queue()
@ -445,8 +445,15 @@ class Machine:
self.cleanup_statedir()
self.state_dir.mkdir(mode=0o700, exist_ok=True)
self.process = None
self.pid = None
self.monitor = None
self.shell = None
self.serial_thread = None
self.booted = False
self.connected = False
@staticmethod
def create_startcommand(args: Dict[str, str]) -> StartCommand:
rootlog.warning(