Merge pull request #169 from jonboulle/pebkac

coreos-cloudinit: apply environment to userdata string
This commit is contained in:
Jonathan Boulle 2014-07-01 12:15:06 -07:00
commit 18068e9375

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 {