'floppy_files' and 'floppy_files' create two separate drives

This commit is contained in:
Michael Kuzmin 2018-02-14 11:01:41 +03:00
parent 47cccb4e02
commit bc3810f5c0
1 changed files with 13 additions and 12 deletions

View File

@ -48,11 +48,6 @@ func (s *StepAddFloppy) runImpl(state multistep.StateBag) error {
d := state.Get("driver").(*driver.Driver)
tmpFloppy := state.Get("floppy_path")
if s.Config.FloppyIMGPath != "" && tmpFloppy != nil {
return fmt.Errorf("'floppy_img_path' cannot be used together with 'floppy_files' and 'floppy_dirs'")
}
var floppyIMGPath string
if tmpFloppy != nil {
ui.Say("Uploading created floppy image")
@ -72,15 +67,21 @@ func (s *StepAddFloppy) runImpl(state multistep.StateBag) error {
// remember the path to the temporary floppy image to remove it after the build is finished
s.uploadedFloppyPath = uploadPath
floppyIMGPath = ds.ResolvePath(uploadPath)
} else {
floppyIMGPath = s.Config.FloppyIMGPath
floppyIMGPath := ds.ResolvePath(uploadPath)
ui.Say("Adding generated Floppy...")
err = vm.AddFloppy(floppyIMGPath)
if err != nil {
return err
}
}
ui.Say("Adding Floppy...")
err := vm.AddFloppy(floppyIMGPath)
if err != nil {
return err
if s.Config.FloppyIMGPath != "" {
floppyIMGPath := s.Config.FloppyIMGPath
ui.Say("Adding Floppy image...")
err := vm.AddFloppy(floppyIMGPath)
if err != nil {
return err
}
}
return nil