Commit 8019cd18 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/amazon: don't chmod on windows

parent 4bb320d8
...@@ -9,6 +9,7 @@ import ( ...@@ -9,6 +9,7 @@ import (
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"log" "log"
"os" "os"
"runtime"
) )
type StepKeyPair struct { type StepKeyPair struct {
...@@ -56,9 +57,11 @@ func (s *StepKeyPair) Run(state map[string]interface{}) multistep.StepAction { ...@@ -56,9 +57,11 @@ func (s *StepKeyPair) Run(state map[string]interface{}) multistep.StepAction {
} }
// Chmod it so that it is SSH ready // Chmod it so that it is SSH ready
if err := f.Chmod(0600); err != nil { if runtime.GOOS != "windows" {
state["error"] = fmt.Errorf("Error setting permissions of debug key: %s", err) if err := f.Chmod(0600); err != nil {
return multistep.ActionHalt state["error"] = fmt.Errorf("Error setting permissions of debug key: %s", err)
return multistep.ActionHalt
}
} }
} }
......
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