diff --git a/command/init.go b/command/init.go index ec5b505bd..0f0b41d81 100644 --- a/command/init.go +++ b/command/init.go @@ -54,6 +54,11 @@ func (c *InitCommand) Run(args []string) int { return 1 } + if c.migrateState && c.reconfigure { + c.Ui.Error("The -migrate-state and -reconfigure options are mutually-exclusive") + return 1 + } + // Copying the state only happens during backend migration, so setting // -force-copy implies -migrate-state if c.forceInitCopy { diff --git a/command/meta_backend.go b/command/meta_backend.go index cce4c3568..2c378ae67 100644 --- a/command/meta_backend.go +++ b/command/meta_backend.go @@ -1114,11 +1114,6 @@ func (m *Meta) backendInitFromConfig(c *configs.Backend) (backend.Backend, cty.V return b, configVal, diags } -func (m *Meta) backendInitRequired(reason string) { - m.Ui.Output(m.Colorize().Color(fmt.Sprintf( - "[reset]"+strings.TrimSpace(errBackendInit)+"\n", reason))) -} - // Helper method to ignore remote backend version conflicts. Only call this // for commands which cannot accidentally upgrade remote state files. func (m *Meta) ignoreRemoteBackendVersionConflict(b backend.Backend) {