Skip to content

Commit

Permalink
Refactor Locker for new syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Jared Ledvina <[email protected]>
  • Loading branch information
jaredledvina committed May 6, 2021
1 parent c39a0f3 commit eb6d096
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
"context"
"fmt"
"io"
"io/ioutil"
Expand All @@ -13,7 +12,9 @@ import (
"github.com/hashicorp/logutils"
backendInit "github.com/hashicorp/terraform/backend/init"
"github.com/hashicorp/terraform/command"
"github.com/hashicorp/terraform/command/arguments"
"github.com/hashicorp/terraform/command/clistate"
"github.com/hashicorp/terraform/command/views"
"github.com/mitchellh/cli"
)

Expand All @@ -34,7 +35,8 @@ func (c *LockCommand) Run(args []string) int {
return 1
}

stateLocker := clistate.NewLocker(context.Background(), (0 * time.Second), c.Ui, c.Colorize())
view := views.NewStateLocker(arguments.ViewHuman, c.View)
stateLocker := clistate.NewLocker((0 * time.Second), view)
if err := stateLocker.Lock(stateFromMgr, "tflock"); err != nil {
c.Ui.Error(fmt.Sprintf("Error locking source state: %s", err))
return 1
Expand Down

0 comments on commit eb6d096

Please sign in to comment.