command/remote: Use PersistState
This commit is contained in:
parent
4e44443aa3
commit
1945e2099a
|
@ -180,12 +180,7 @@ func (c *RemoteCommand) initBlankState() int {
|
||||||
blank.Remote = &c.remoteConf
|
blank.Remote = &c.remoteConf
|
||||||
|
|
||||||
// Persist the state
|
// Persist the state
|
||||||
buf := bytes.NewBuffer(nil)
|
if err := remote.PersistState(blank); err != nil {
|
||||||
if err := terraform.WriteState(blank, buf); err != nil {
|
|
||||||
c.Ui.Error(fmt.Sprintf("Failed to encode state: %v", err))
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
if err := remote.Persist(buf); err != nil {
|
|
||||||
c.Ui.Error(fmt.Sprintf("Failed to initialize state file: %v", err))
|
c.Ui.Error(fmt.Sprintf("Failed to initialize state file: %v", err))
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue