command: More logging during migration

This just finishes off the logging added in earlier commits to get all
the way through to the actual migration call.
This commit is contained in:
Martin Atkins 2018-11-14 15:08:36 -08:00
parent f39a5d0962
commit 6c7cecfbd8
1 changed files with 3 additions and 0 deletions

View File

@ -375,9 +375,11 @@ func (m *Meta) backendMigrateState_s_s(opts *backendMigrateOpts) error {
// Confirm with the user whether we want to copy state over
confirm, err := confirmFunc(stateOne, stateTwo, opts)
if err != nil {
log.Print("[TRACE] backendMigrateState: error reading input, so aborting migration")
return err
}
if !confirm {
log.Print("[TRACE] backendMigrateState: user cancelled at confirmation prompt, so aborting migration")
return nil
}
}
@ -385,6 +387,7 @@ func (m *Meta) backendMigrateState_s_s(opts *backendMigrateOpts) error {
// Confirmed! We'll have the statemgr package handle the migration, which
// includes preserving any lineage/serial information where possible, if
// both managers support such metadata.
log.Print("[TRACE] backendMigrateState: migration confirmed, so migrating")
if err := statemgr.Migrate(stateTwo, stateOne); err != nil {
return fmt.Errorf(strings.TrimSpace(errBackendStateCopy),
opts.OneType, opts.TwoType, err)