From: Daan De Meyer Date: Tue, 19 Apr 2022 17:31:08 +0000 (+0200) Subject: machine: Pass a list of arguments to pexpect instead of a single string X-Git-Tag: v13~27^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=693aa7a2572cedcfbeb9fe6e35027ea5dd61bb94;p=thirdparty%2Fmkosi.git machine: Pass a list of arguments to pexpect instead of a single string --- diff --git a/mkosi/machine.py b/mkosi/machine.py index 336746ecf..e8519c902 100644 --- a/mkosi/machine.py +++ b/mkosi/machine.py @@ -138,14 +138,15 @@ class Machine: else: die("No valid verb was entered.") - cmd = " ".join(str(x) for x in cmdline) + cmd = [str(x) for x in cmdline] # Here we have something equivalent to the command lines used on spawn() and run() from backend.py. # We use pexpect to boot an image that we will be able to interact with in the future. # Then we tell the process to look for the # sign, which indicates the CLI for that image is active. # Once we've build/boot an image the CLI will prompt "root@image ~]# ". # Then, when pexpects finds the '#' it means we're ready to interact with the process. - self._serial = pexpect.spawnu(cmd, logfile=LogfileAdapter(sys.stdout), timeout=240) + self._serial = pexpect.spawnu(command=cmd[0], args=cmd[1:], logfile=LogfileAdapter(sys.stdout), + timeout=240) self._serial.expect("#") self.stack = stack.pop_all()