core: Don't try to run provisioners with nil state

If a resource has been removed altogether then we have nothing to
provision.
pull/19086/head
Martin Atkins 8 years ago
parent 3e64311dc2
commit e22f1d5dce

@ -205,6 +205,10 @@ type EvalApplyProvisioners struct {
// TODO: test
func (n *EvalApplyProvisioners) Eval(ctx EvalContext) (interface{}, error) {
state := *n.State
if state == nil {
log.Printf("[TRACE] EvalApplyProvisioners: %s has no state, so skipping provisioners", n.Addr)
return nil, nil
}
// The hook API still uses the legacy InstanceInfo type, so we need to shim it.
legacyInfo := NewInstanceInfo(n.Addr.Absolute(ctx.Path()))

Loading…
Cancel
Save