Merge pull request #5802 from arizvisa/GH-5789

Some chances to log errors were missed inside step_create_floppy.go for floppy_files
This commit is contained in:
Matthew Hooker 2018-01-19 15:49:03 -08:00 committed by GitHub
commit 5ef0c2280f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

View File

@ -155,7 +155,10 @@ func (s *StepCreateFloppy) Run(state multistep.StateBag) multistep.StepAction {
}
for _, crawlfilename := range crawlDirectoryFiles {
s.Add(cache, crawlfilename)
if err = s.Add(cache, crawlfilename); err != nil {
state.Put("error", fmt.Errorf("Error adding file from floppy_files : %s : %s", filename, err))
return multistep.ActionHalt
}
s.FilesAdded[crawlfilename] = true
}
@ -165,7 +168,10 @@ func (s *StepCreateFloppy) Run(state multistep.StateBag) multistep.StepAction {
// add just a single file
ui.Message(fmt.Sprintf("Copying file: %s", filename))
s.Add(cache, filename)
if err = s.Add(cache, filename); err != nil {
state.Put("error", fmt.Errorf("Error adding file from floppy_files : %s : %s", filename, err))
return multistep.ActionHalt
}
s.FilesAdded[filename] = true
}
ui.Message("Done copying files from floppy_files")