Merge pull request #2207 from mitchellh/f-amazon-allow-ami-name-spaces

builder/amazon: Allow spaces in AMI names
This commit is contained in:
Clint 2015-06-11 08:49:21 -05:00
commit 900f3641c5
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,7 @@ func isalphanumeric(b byte) bool {
// Clean up AMI name by replacing invalid characters with "-"
func templateCleanAMIName(s string) string {
allowed := []byte{'(', ')', ',', '/', '-', '_'}
allowed := []byte{'(', ')', ',', '/', '-', '_', ' '}
b := []byte(s)
newb := make([]byte, len(b))
for i, c := range b {

View File

@ -5,8 +5,8 @@ import (
)
func TestAMITemplatePrepare_clean(t *testing.T) {
origName := "AMZamz09(),/-_:&^$%"
expected := "AMZamz09(),/-_-----"
origName := "AMZamz09(),/-_:&^ $%"
expected := "AMZamz09(),/-_--- --"
name := templateCleanAMIName(origName)