Commit 90467109 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

windows: Simplify the VM boot monitoring code

There is no need to use PowerShell to write the random token to the
serial port. Doing 'echo token > COM1' will do the trick.
parent 52284449
......@@ -462,12 +462,7 @@ class Windows(OSBase):
# This script will send a random string to the first serial port. This
# can be used to determine when the OS has booted.
token = "".join(random.choice(string.ascii_letters) for x in range(16))
commands['BootMonitor'] = \
(r'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe '
r'-ExecutionPolicy RemoteSigned '
r'"&{$port=new-Object System.IO.Ports.SerialPort COM1,9600,'
r'None,8,one;$port.open();$port.WriteLine(\"' + token + r'\");'
r'$port.Close()}"')
commands['BootMonitor'] = "cmd /q /a /c echo " + token + " > COM1"
# This will update the password of the admin user to self.vm.password
commands["UpdatePassword"] = "net user %s %s" % \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment