From 9fc8ed02aebab87de9808ed6ca23760e00e15ca0 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Wed, 20 Nov 2019 15:21:08 -0800 Subject: [PATCH] Don't cache when TargetPath is non-nil; this messes up use of the iso_target_path iso template option. --- common/step_download.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/common/step_download.go b/common/step_download.go index fb84ceb10..332a8dd69 100644 --- a/common/step_download.go +++ b/common/step_download.go @@ -150,11 +150,9 @@ func (s *StepDownload) download(ctx context.Context, ui packer.Ui, source string if 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" log.Printf("Acquiring lock for: %s (%s)", u.String(), lockFile)