From 8019cd18390e33f5b781a335cf3103448efa5318 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 30 Aug 2013 15:04:23 -0700 Subject: [PATCH] builder/amazon: don't chmod on windows --- builder/amazon/common/step_key_pair.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/builder/amazon/common/step_key_pair.go b/builder/amazon/common/step_key_pair.go index 25f9de041..413ef537f 100644 --- a/builder/amazon/common/step_key_pair.go +++ b/builder/amazon/common/step_key_pair.go @@ -9,6 +9,7 @@ import ( "github.com/mitchellh/packer/packer" "log" "os" + "runtime" ) type StepKeyPair struct { @@ -56,9 +57,11 @@ func (s *StepKeyPair) Run(state map[string]interface{}) multistep.StepAction { } // Chmod it so that it is SSH ready - if err := f.Chmod(0600); err != nil { - state["error"] = fmt.Errorf("Error setting permissions of debug key: %s", err) - return multistep.ActionHalt + if runtime.GOOS != "windows" { + if err := f.Chmod(0600); err != nil { + state["error"] = fmt.Errorf("Error setting permissions of debug key: %s", err) + return multistep.ActionHalt + } } }