mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Make backend.StateMgr accept a context (#780)
Signed-off-by: Marcin Wyszynski <marcin.pixie@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package command
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
@@ -101,7 +102,8 @@ func (c *WorkspaceNewCommand) Run(args []string) int {
|
||||
}
|
||||
}
|
||||
|
||||
_, err = b.StateMgr(workspace)
|
||||
ctx := context.Background()
|
||||
_, err = b.StateMgr(ctx, workspace)
|
||||
if err != nil {
|
||||
c.Ui.Error(err.Error())
|
||||
return 1
|
||||
@@ -122,7 +124,7 @@ func (c *WorkspaceNewCommand) Run(args []string) int {
|
||||
}
|
||||
|
||||
// load the new Backend state
|
||||
stateMgr, err := b.StateMgr(workspace)
|
||||
stateMgr, err := b.StateMgr(ctx, workspace)
|
||||
if err != nil {
|
||||
c.Ui.Error(err.Error())
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user