From e2daefab71c9547ab13ee83be40ea0f875655bee Mon Sep 17 00:00:00 2001 From: Brian Hicks Date: Tue, 27 Dec 2016 11:20:20 -0600 Subject: [PATCH] provisioner(converge): improve error messages when Converge isn't found --- provisioner/converge/provisioner.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/provisioner/converge/provisioner.go b/provisioner/converge/provisioner.go index 45d5078ce..49557a67d 100644 --- a/provisioner/converge/provisioner.go +++ b/provisioner/converge/provisioner.go @@ -113,9 +113,17 @@ func (p *Provisioner) checkVersion(ui packer.Ui, comm packer.Communicator) error } cmd.Wait() - if cmd.ExitStatus != 0 { + if cmd.ExitStatus == 127 { + ui.Error("Could not determine Converge version. Is it installed and in PATH?") + if p.config.NoBootstrap { + ui.Error("Bootstrapping was disabled for this run. That might be why Converge isn't present.") + } + + return errors.New("could not determine Converge version") + + } else if cmd.ExitStatus != 0 { ui.Error(versionOut.String()) - ui.Error(fmt.Sprintf("exited with error code %d", cmd.ExitStatus)) // TODO: check for 127 + ui.Error(fmt.Sprintf("exited with error code %d", cmd.ExitStatus)) return errors.New("Error running `converge version`") }