From 2b3855d5e29ff59eb09a92f9e710a4a2119221ee Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 3 Jul 2014 11:28:47 -0700 Subject: [PATCH] terraform: make all actions cancellable in context --- terraform/context.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/terraform/context.go b/terraform/context.go index d558e8dfd..ae964aabe 100644 --- a/terraform/context.go +++ b/terraform/context.go @@ -117,6 +117,9 @@ func (c *Context) Apply() (*State, error) { // Plan also updates the diff of this context to be the diff generated // by the plan, so Apply can be called after. func (c *Context) Plan(opts *PlanOpts) (*Plan, error) { + v := c.acquireRun() + defer c.releaseRun(v) + g, err := Graph(&GraphOpts{ Config: c.config, Providers: c.providers, @@ -146,6 +149,9 @@ func (c *Context) Plan(opts *PlanOpts) (*Plan, error) { // Even in the case an error is returned, the state will be returned and // will potentially be partially updated. func (c *Context) Refresh() (*State, error) { + v := c.acquireRun() + defer c.releaseRun(v) + g, err := Graph(&GraphOpts{ Config: c.config, Providers: c.providers,