Merge pull request #6525 from hashicorp/fix_6524

don't fail if you can't find abs or relative path.
This commit is contained in:
Megan Marsh 2018-07-25 09:23:22 -07:00 committed by GitHub
commit 5fb6f69ad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"bufio"
"errors"
"fmt"
"log"
"net/http"
"net/url"
"os"
@ -147,12 +148,14 @@ func (c *ISOConfig) parseCheckSumFile(rd *bufio.Reader) error {
absPath, err := filepath.Abs(u.Path)
if err != nil {
return fmt.Errorf("Unable to generate absolute path from provided iso_url: %s", err)
log.Printf("Unable to generate absolute path from provided iso_url: %s", err)
absPath = ""
}
relpath, err := filepath.Rel(filepath.Dir(checksumurl.Path), absPath)
if err != nil {
return err
log.Printf("Unable to determine relative pathing; continuing with abspath.")
relpath = ""
}
filename := filepath.Base(u.Path)