Remove code to preserve legacy export dir structure from the export step

Store the export path in the state bag in preparation for use in a later
step
This commit is contained in:
DanHam 2018-07-08 11:57:15 +01:00
parent bd5692451b
commit 232dd8f0a6
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 2 additions and 13 deletions

View File

@ -42,20 +42,9 @@ func (s *StepExportVm) Run(_ context.Context, state multistep.StateBag) multiste
return multistep.ActionHalt return multistep.ActionHalt
} }
// Shuffle around the exported folders to maintain backwards // Store the path to the export directory for later steps
// compatibility. This moves the 'Snapshots', 'Virtual Hard Disks' and
// 'Virtual Machines' directories from <output directory>/<vm name> so
// they appear directly under <output directory>. The empty '<output
// directory>/<vm name>' directory is removed when complete.
// The 'Snapshots' folder will not be moved into the output directory
// if it is empty.
exportPath := filepath.Join(s.OutputDir, vmName) exportPath := filepath.Join(s.OutputDir, vmName)
err = driver.PreserveLegacyExportBehaviour(exportPath, s.OutputDir) state.Put("export_path", exportPath)
if err != nil {
// No need to halt here; Just warn the user instead
err = fmt.Errorf("WARNING: Error restoring legacy export dir structure: %s", err)
ui.Error(err.Error())
}
return multistep.ActionContinue return multistep.ActionContinue
} }