From a0867b5d49076770b36a19677450247ec0afb1dd Mon Sep 17 00:00:00 2001 From: James Phillips Date: Wed, 19 Jul 2017 22:15:04 -0700 Subject: [PATCH] Tweaks the error when scripts are disabled. This will hopefully help people self-serve if they upgrade without accounting for this. --- agent/agent.go | 2 +- agent/agent_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/agent.go b/agent/agent.go index a813afe4d..8fc32dce2 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -1629,7 +1629,7 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType, } if chkType.IsScript() && !a.config.EnableScriptChecks { - return fmt.Errorf("Check types that exec scripts are disabled on this agent") + return fmt.Errorf("Scripts are disabled on this agent; to enable, configure 'enable_script_checks' to true") } } diff --git a/agent/agent_test.go b/agent/agent_test.go index c19ab9832..d366d5b7e 100644 --- a/agent/agent_test.go +++ b/agent/agent_test.go @@ -822,7 +822,7 @@ func TestAgent_AddCheck_ExecDisable(t *testing.T) { Interval: 15 * time.Second, } err := a.AddCheck(health, chk, false, "") - if err == nil || !strings.Contains(err.Error(), "exec scripts are disabled on this agent") { + if err == nil || !strings.Contains(err.Error(), "Scripts are disabled on this agent") { t.Fatalf("err: %v", err) }