Skip to content

Commit

Permalink
terraform: don't panic if no state in Walk return [GH-403]
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Oct 16, 2014
1 parent 2a388fd commit 5596ee7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
## 0.3.1 (unreleased)

BUG FIXES:

* core: Remove panic case when applying with a plan that generates no
new state. [GH-403]

## 0.3.0 (October 14, 2014)

Expand Down
6 changes: 3 additions & 3 deletions terraform/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,13 +517,13 @@ func (c *walkContext) Walk() error {
// Likewise, if we have no resources in our state, we're done. This
// guards against the case that we destroyed.
mod := c.Context.state.ModuleByPath(c.Path)
if mod == nil {
return nil
}
if c.Operation == walkApply {
// On Apply, we prune so that we don't do outputs if we destroyed
mod.prune()
}
if mod == nil || len(mod.Resources) == 0 {
return nil
}
if len(mod.Resources) == 0 {
mod.Outputs = nil
return nil
Expand Down

0 comments on commit 5596ee7

Please sign in to comment.