forked from hashicorp/terraform
-
Notifications
You must be signed in to change notification settings - Fork 2
/
lock.go
38 lines (30 loc) · 915 Bytes
/
lock.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package state
import (
"github.com/hashicorp/terraform/terraform"
)
// LockDisabled implements State and Locker but disables state locking.
// If State doesn't support locking, this is a no-op. This is useful for
// easily disabling locking of an existing state or for tests.
type LockDisabled struct {
// We can't embed State directly since Go dislikes that a field is
// State and State interface has a method State
Inner State
}
func (s *LockDisabled) State() *terraform.State {
return s.Inner.State()
}
func (s *LockDisabled) WriteState(v *terraform.State) error {
return s.Inner.WriteState(v)
}
func (s *LockDisabled) RefreshState() error {
return s.Inner.RefreshState()
}
func (s *LockDisabled) PersistState() error {
return s.Inner.PersistState()
}
func (s *LockDisabled) Lock(info *LockInfo) (string, error) {
return "", nil
}
func (s *LockDisabled) Unlock(id string) error {
return nil
}