From 73d5593242798f868fcb0f80bc9daf853a7fae7d Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Tue, 27 Dec 2016 11:41:52 -0600 Subject: [PATCH] provisioner(converge): add validate for source and destination --- provisioner/converge/provisioner.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/provisioner/converge/provisioner.go b/provisioner/converge/provisioner.go index f00e04d82..57e08ad07 100644 --- a/provisioner/converge/provisioner.go +++ b/provisioner/converge/provisioner.go @@ -53,6 +53,19 @@ func (p *Provisioner) Prepare(raws ...interface{}) error { }, raws..., ) + if err != nil { + return err + } + + // validate sources and destinations + for i, dir := range p.config.ModuleDirs { + if dir.Source == "" { + return fmt.Errorf("Source (\"source\" key) is required in Converge module dir #%d", i) + } + if dir.Destination == "" { + return fmt.Errorf("Destination (\"destination\" key) is required in Converge module dir #%d", i) + } + } return err }