From 5a9e5df967ceb223f65fb316e9ebf2902637e1e6 Mon Sep 17 00:00:00 2001 From: Neeki Patel Date: Tue, 16 Dec 2014 09:27:30 -0500 Subject: [PATCH 1/2] Allow manifest_file to be a directory Puppet is removing support for imports and node inherits. This change will support directories as manifests https://docs.puppetlabs.com/puppet/latest/reference/dirs_manifest.html https://docs.puppetlabs.com/puppet/latest/reference/lang_import.html --- provisioner/puppet-masterless/provisioner.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/provisioner/puppet-masterless/provisioner.go b/provisioner/puppet-masterless/provisioner.go index 81ab34afa..6cd62c28b 100644 --- a/provisioner/puppet-masterless/provisioner.go +++ b/provisioner/puppet-masterless/provisioner.go @@ -180,9 +180,6 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { if err != nil { errs = packer.MultiErrorAppend(errs, fmt.Errorf("manifest_file is invalid: %s", err)) - } else if info.IsDir() { - errs = packer.MultiErrorAppend(errs, - fmt.Errorf("manifest_file must point to a file")) } } From 027b43ea05171ac761fa0c913945a95bf02893ae Mon Sep 17 00:00:00 2001 From: Neeki Patel Date: Tue, 16 Dec 2014 09:49:57 -0500 Subject: [PATCH 2/2] Fixed info declared and not used --- provisioner/puppet-masterless/provisioner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provisioner/puppet-masterless/provisioner.go b/provisioner/puppet-masterless/provisioner.go index 6cd62c28b..307ecce38 100644 --- a/provisioner/puppet-masterless/provisioner.go +++ b/provisioner/puppet-masterless/provisioner.go @@ -176,7 +176,7 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { errs = packer.MultiErrorAppend(errs, fmt.Errorf("A manifest_file must be specified.")) } else { - info, err := os.Stat(p.config.ManifestFile) + _, err := os.Stat(p.config.ManifestFile) if err != nil { errs = packer.MultiErrorAppend(errs, fmt.Errorf("manifest_file is invalid: %s", err))