terraform: Move the config initialization of provisioners

This commit is contained in:
Armon Dadgar 2014-07-09 14:48:25 -07:00
parent 1c4321a503
commit 2423d135ac
2 changed files with 1 additions and 8 deletions

View File

@ -814,14 +814,6 @@ func (c *Context) genericWalkFn(cb genericWalkFunc) depgraph.WalkFunc {
} else { } else {
rn.Resource.Config = NewResourceConfig(rn.Config.RawConfig) rn.Resource.Config = NewResourceConfig(rn.Config.RawConfig)
} }
for _, prov := range rn.Resource.Provisioners {
if prov.RawConfig == nil {
prov.Config = new(ResourceConfig)
} else {
prov.Config = NewResourceConfig(prov.RawConfig)
}
}
} else { } else {
rn.Resource.Config = nil rn.Resource.Config = nil
} }

View File

@ -772,6 +772,7 @@ func graphMapResourceProvisioners(g *depgraph.Graph,
// Save the provisioner // Save the provisioner
rn.Resource.Provisioners = append(rn.Resource.Provisioners, &ResourceProvisionerConfig{ rn.Resource.Provisioners = append(rn.Resource.Provisioners, &ResourceProvisionerConfig{
Provisioner: provisioner, Provisioner: provisioner,
Config: NewResourceConfig(p.RawConfig),
RawConfig: p.RawConfig, RawConfig: p.RawConfig,
}) })
} }