|
|
|
|
@ -51,6 +51,11 @@ func (c *StateMvCommand) Run(args []string) int {
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := stateFrom.RefreshState(); err != nil {
|
|
|
|
|
c.Ui.Error(fmt.Sprintf("Failed to load state: %s", err))
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Read the destination state
|
|
|
|
|
stateTo := stateFrom
|
|
|
|
|
stateToReal := stateFromReal
|
|
|
|
|
@ -61,6 +66,11 @@ func (c *StateMvCommand) Run(args []string) int {
|
|
|
|
|
return cli.RunResultHelp
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if err := stateTo.RefreshState(); err != nil {
|
|
|
|
|
c.Ui.Error(fmt.Sprintf("Failed to load state: %s", err))
|
|
|
|
|
return 1
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
stateToReal = stateTo.State()
|
|
|
|
|
if stateToReal == nil {
|
|
|
|
|
stateToReal = terraform.NewState()
|
|
|
|
|
|