Don't cache when TargetPath is non-nil; this messes up use of the iso_target_path iso template option.

This commit is contained in:
Megan Marsh 2019-11-20 15:21:08 -08:00
parent ca4bb238f7
commit 9fc8ed02ae
1 changed files with 2 additions and 4 deletions

View File

@ -150,11 +150,9 @@ func (s *StepDownload) download(ctx context.Context, ui packer.Ui, source string
if s.Extension != "" { if s.Extension != "" {
targetPath += "." + s.Extension targetPath += "." + s.Extension
} }
targetPath, err = packer.CachePath(targetPath)
} }
targetPath, err = packer.CachePath(targetPath)
if err != nil {
return "", fmt.Errorf("CachePath: %s", err)
}
lockFile := targetPath + ".lock" lockFile := targetPath + ".lock"
log.Printf("Acquiring lock for: %s (%s)", u.String(), lockFile) log.Printf("Acquiring lock for: %s (%s)", u.String(), lockFile)