From d1961b7c8e38869a8927830a5dcbeb776f2d6869 Mon Sep 17 00:00:00 2001 From: Taliesin Sisson Date: Sat, 7 Nov 2015 17:07:40 +0000 Subject: [PATCH] Echo output when its used --- builder/hyperv/common/step_type_boot_command.go | 10 +++++----- powershell/hyperv/hyperv.go | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/builder/hyperv/common/step_type_boot_command.go b/builder/hyperv/common/step_type_boot_command.go index c801858b7..e121ebad2 100644 --- a/builder/hyperv/common/step_type_boot_command.go +++ b/builder/hyperv/common/step_type_boot_command.go @@ -154,19 +154,19 @@ func scancodes(message string) []string { var scancode []string if strings.HasPrefix(message, "") { - log.Printf("Special code found, will sleep 1 second at this point.") + //log.Printf("Special code found, will sleep 1 second at this point.") scancode = []string{"wait"} message = message[len(""):] } if strings.HasPrefix(message, "") { - log.Printf("Special code found, will sleep 5 seconds at this point.") + //log.Printf("Special code found, will sleep 5 seconds at this point.") scancode = []string{"wait5"} message = message[len(""):] } if strings.HasPrefix(message, "") { - log.Printf("Special code found, will sleep 10 seconds at this point.") + //log.Printf("Special code found, will sleep 10 seconds at this point.") scancode = []string{"wait10"} message = message[len(""):] } @@ -174,7 +174,7 @@ func scancodes(message string) []string { if scancode == nil { for specialCode, specialValue := range special { if strings.HasPrefix(message, specialCode) { - log.Printf("Special code '%s' found, replacing with: %s", specialCode, specialValue) + //log.Printf("Special code '%s' found, replacing with: %s", specialCode, specialValue) scancode = specialValue message = message[len(specialCode):] break @@ -200,7 +200,7 @@ func scancodes(message string) []string { } scancode = append(scancode, fmt.Sprintf("%02x", scancodeInt+0x80)) - log.Printf("Sending char '%c', code '%v', shift %v", r, scancode, keyShift) + //log.Printf("Sending char '%c', code '%v', shift %v", r, scancode, keyShift) } result = append(result, scancode...) diff --git a/powershell/hyperv/hyperv.go b/powershell/hyperv/hyperv.go index 0d86d441c..28213605a 100644 --- a/powershell/hyperv/hyperv.go +++ b/powershell/hyperv/hyperv.go @@ -783,6 +783,7 @@ param([string]$vmName, [string]$scanCodes) $timeToWait = "1" } + write-host "Special code found, will sleep $timeToWait second(s) at this point." Start-Sleep -s $timeToWait if ($scanCodesToSend){ @@ -796,8 +797,10 @@ param([string]$vmName, [string]$scanCodes) $scanCodesToSend = '' } else { if ($scanCodesToSend){ + write-host "Sending special code '$scanCodesToSend' '$scanCode'" $scanCodesToSend = "$scanCodesToSend $scanCode" } else { + write-host "Sending char '$scanCode'" $scanCodesToSend = "$scanCode" } }