coreos-cloudinit: apply environment to userdata string

This commit is contained in:
Jonathan Boulle 2014-07-01 12:08:42 -07:00
parent 1be2bec1c2
commit 1b3cabb035

View File

@ -112,7 +112,9 @@ func main() {
} }
} }
// Apply environment to user-data
env := initialize.NewEnvironment("/", ds.ConfigRoot(), workspace, convertNetconf, sshKeyName, subs) env := initialize.NewEnvironment("/", ds.ConfigRoot(), workspace, convertNetconf, sshKeyName, subs)
userdata := env.Apply(string(userdataBytes))
var ccm, ccu *initialize.CloudConfig var ccm, ccu *initialize.CloudConfig
var script *system.Script var script *system.Script
@ -120,7 +122,7 @@ func main() {
fmt.Printf("Failed to parse meta-data: %v\n", err) fmt.Printf("Failed to parse meta-data: %v\n", err)
die() die()
} }
if ud, err := initialize.ParseUserData(string(userdataBytes)); err != nil { if ud, err := initialize.ParseUserData(userdata); err != nil {
fmt.Printf("Failed to parse user-data: %v\n", err) fmt.Printf("Failed to parse user-data: %v\n", err)
die() die()
} else { } else {