From 2e5f3da5c1ba4c323c6e938d7a2f82615260412f Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 5 Sep 2014 16:38:05 -0700 Subject: [PATCH] builder/amazon: fix {{uuid}} default not being replaced --- builder/amazon/common/run_config.go | 7 +++++-- packer/config_template.go | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/builder/amazon/common/run_config.go b/builder/amazon/common/run_config.go index e0b63aad9..6cd2f3e73 100644 --- a/builder/amazon/common/run_config.go +++ b/builder/amazon/common/run_config.go @@ -3,9 +3,11 @@ package common import ( "errors" "fmt" - "github.com/mitchellh/packer/packer" "os" "time" + + "github.com/mitchellh/packer/common/uuid" + "github.com/mitchellh/packer/packer" ) // RunConfig contains configuration for running an instance from a source @@ -81,7 +83,8 @@ func (c *RunConfig) Prepare(t *packer.ConfigTemplate) []error { } if c.TemporaryKeyPairName == "" { - c.TemporaryKeyPairName = "packer {{uuid}}" + c.TemporaryKeyPairName = fmt.Sprintf( + "packer %s", uuid.TimeOrderedUUID()) } // Validation diff --git a/packer/config_template.go b/packer/config_template.go index b93226d93..47b096227 100644 --- a/packer/config_template.go +++ b/packer/config_template.go @@ -3,12 +3,13 @@ package packer import ( "bytes" "fmt" - "github.com/mitchellh/packer/common/uuid" "os" "strconv" "strings" "text/template" "time" + + "github.com/mitchellh/packer/common/uuid" ) // InitTime is the UTC time when this package was initialized. It is