Merge pull request #2258 from mitchellh/b-puppet-manifest-base
provisioner/puppet-masterless: only base if manifest is a file [GH-1933]
This commit is contained in:
commit
5ee02b09b2
|
@ -276,7 +276,15 @@ func (p *Provisioner) uploadManifests(ui packer.Ui, comm packer.Communicator) (s
|
||||||
}
|
}
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
|
||||||
manifestFilename := filepath.Base(p.config.ManifestFile)
|
manifestFilename := p.config.ManifestFile
|
||||||
|
if fi, err := os.Stat(p.config.ManifestFile); err != nil {
|
||||||
|
return "", fmt.Errorf("Error inspecting manifest file: %s", err)
|
||||||
|
} else if !fi.IsDir() {
|
||||||
|
manifestFilename = filepath.Base(manifestFilename)
|
||||||
|
} else {
|
||||||
|
ui.Say("WARNING: manifest_file should be a file. Use manifest_dir for directories")
|
||||||
|
}
|
||||||
|
|
||||||
remoteManifestFile := fmt.Sprintf("%s/%s", remoteManifestsPath, manifestFilename)
|
remoteManifestFile := fmt.Sprintf("%s/%s", remoteManifestsPath, manifestFilename)
|
||||||
if err := comm.Upload(remoteManifestFile, f, nil); err != nil {
|
if err := comm.Upload(remoteManifestFile, f, nil); err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
|
Loading…
Reference in New Issue