builder/amazon: don't chmod on windows
This commit is contained in:
parent
4bb320d86f
commit
8019cd1839
|
@ -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,11 +57,13 @@ 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 runtime.GOOS != "windows" {
|
||||||
if err := f.Chmod(0600); err != nil {
|
if err := f.Chmod(0600); err != nil {
|
||||||
state["error"] = fmt.Errorf("Error setting permissions of debug key: %s", err)
|
state["error"] = fmt.Errorf("Error setting permissions of debug key: %s", err)
|
||||||
return multistep.ActionHalt
|
return multistep.ActionHalt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return multistep.ActionContinue
|
return multistep.ActionContinue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue