Commit 900f3641 authored by Clint's avatar Clint

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

builder/amazon: Allow spaces in AMI names
parents 9c1e4614 2056fda4
......@@ -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 {
......
......@@ -5,8 +5,8 @@ import (
)
func TestAMITemplatePrepare_clean(t *testing.T) {
origName := "AMZamz09(),/-_:&^$%"
expected := "AMZamz09(),/-_-----"
origName := "AMZamz09(),/-_:&^ $%"
expected := "AMZamz09(),/-_--- --"
name := templateCleanAMIName(origName)
......
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