Do not unlink file while it is still open

- inside RunJob() there is a deferred function which will remove
  the entire temporary directory in which images are created, including
  the streamOptimized file

- inside testBootUsingVMware(), which wants to use this function,
  there is already a deferred function which removes the converted
  image
This commit is contained in:
Alexander Todorov 2020-08-24 08:56:21 -04:00 committed by Ondřej Budai
parent e7aa9c10c2
commit 3292b5eb68

View file

@ -18,9 +18,5 @@ func OpenAsStreamOptimizedVmdk(imagePath string) (*os.File, error) {
if err != nil {
return nil, err
}
err = os.Remove(newPath)
if err != nil {
return nil, err
}
return f, err
}