]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
machine: Pass a list of arguments to pexpect instead of a single string
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 19 Apr 2022 17:31:08 +0000 (19:31 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 19 May 2022 09:08:16 +0000 (11:08 +0200)
mkosi/machine.py

index 336746ecfa765a5adffeb79561cf455a7e0bc489..e8519c902dba5afb742a6a6a3fb5c2f23e7c7ceb 100644 (file)
@@ -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()