Merge pull request #2539 from fnoeding/amazon-ebs-fix-ec-user-data-encoding
amazon builder: always base64 encode ec2 user data
This commit is contained in:
commit
e6b6f0b020
|
@ -55,14 +55,13 @@ func (s *StepRunSourceInstance) Run(state multistep.StateBag) multistep.StepActi
|
|||
return multistep.ActionHalt
|
||||
}
|
||||
|
||||
// Test if it is encoded already, and if not, encode it
|
||||
if _, err := base64.StdEncoding.DecodeString(string(contents)); err != nil {
|
||||
log.Printf("[DEBUG] base64 encoding user data...")
|
||||
contents = []byte(base64.StdEncoding.EncodeToString(contents))
|
||||
}
|
||||
|
||||
userData = string(contents)
|
||||
}
|
||||
|
||||
// Test if it is encoded already, and if not, encode it
|
||||
if _, err := base64.StdEncoding.DecodeString(userData); err != nil {
|
||||
log.Printf("[DEBUG] base64 encoding user data...")
|
||||
userData = base64.StdEncoding.EncodeToString([]byte(userData))
|
||||
}
|
||||
|
||||
ui.Say("Launching a source AWS instance...")
|
||||
|
|
Loading…
Reference in New Issue