terraform: clean up some functions

This commit is contained in:
Mitchell Hashimoto 2014-09-24 19:36:00 -07:00
parent 2d07f79c5a
commit 8420b58015
1 changed files with 12 additions and 11 deletions

View File

@ -117,7 +117,13 @@ func (c *Context) Apply() (*State, error) {
// Graph returns the graph for this context.
func (c *Context) Graph() (*depgraph.Graph, error) {
return c.graph()
return Graph(&GraphOpts{
Diff: c.diff,
Module: c.module,
Providers: c.providers,
Provisioners: c.provisioners,
State: c.state,
})
}
// Plan generates an execution plan for the given context.
@ -248,16 +254,6 @@ func (c *Context) Validate() ([]string, []error) {
return walkMeta.Warns, errs
}
func (c *Context) graph() (*depgraph.Graph, error) {
return Graph(&GraphOpts{
Diff: c.diff,
Module: c.module,
Providers: c.providers,
Provisioners: c.provisioners,
State: c.state,
})
}
func (c *Context) acquireRun() chan<- struct{} {
c.l.Lock()
defer c.l.Unlock()
@ -389,6 +385,11 @@ func (c *walkContext) Walk() error {
return err
}
if c.Operation == walkValidate {
// Validation is the only one that doesn't calculate outputs
return nil
}
// We did an apply, so we need to calculate the outputs. If we have no
// outputs, then we're done.
m := c.Context.module