Commit 76071eaf authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/amazon/chroot: only let it run on Linux

parent bbcb2ea4
...@@ -5,12 +5,14 @@ ...@@ -5,12 +5,14 @@
package chroot package chroot
import ( import (
"errors"
"github.com/mitchellh/goamz/ec2" "github.com/mitchellh/goamz/ec2"
"github.com/mitchellh/multistep" "github.com/mitchellh/multistep"
awscommon "github.com/mitchellh/packer/builder/amazon/common" awscommon "github.com/mitchellh/packer/builder/amazon/common"
"github.com/mitchellh/packer/builder/common" "github.com/mitchellh/packer/builder/common"
"github.com/mitchellh/packer/packer" "github.com/mitchellh/packer/packer"
"log" "log"
"runtime"
) )
// The unique ID for this builder // The unique ID for this builder
...@@ -51,6 +53,10 @@ func (b *Builder) Prepare(raws ...interface{}) error { ...@@ -51,6 +53,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
} }
func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error) { func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packer.Artifact, error) {
if runtime.GOOS != "linux" {
return nil, errors.New("The amazon-chroot builder only works on Linux environments.")
}
region, err := b.config.Region() region, err := b.config.Region()
if err != nil { if err != nil {
return nil, err return nil, err
......
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