From bf6384a163390062cee54ca59887c02ca074a82d Mon Sep 17 00:00:00 2001 From: James Bardin Date: Fri, 31 Mar 2017 16:30:51 -0400 Subject: [PATCH] All states are lockers Since moving to the new backends, all states (except InmemState) are Lockers. Add the methods to the State interface to remove a heap of assertion checks. --- state/inmem.go | 8 ++++++++ state/state.go | 1 + 2 files changed, 9 insertions(+) diff --git a/state/inmem.go b/state/inmem.go index ff8daab8fa..a930f78c79 100644 --- a/state/inmem.go +++ b/state/inmem.go @@ -26,3 +26,11 @@ func (s *InmemState) WriteState(state *terraform.State) error { func (s *InmemState) PersistState() error { return nil } + +func (s *InmemState) Lock(*LockInfo) (string, error) { + return "", nil +} + +func (s *InmemState) Unlock(string) error { + return nil +} diff --git a/state/state.go b/state/state.go index 9491958a39..39f81c9d1a 100644 --- a/state/state.go +++ b/state/state.go @@ -28,6 +28,7 @@ type State interface { StateWriter StateRefresher StatePersister + Locker } // StateReader is the interface for things that can return a state. Retrieving