From 1774fdc2377cd24731d53ffc6f75ac4f60457643 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 a813afe4d1..8fc32dce27 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 c19ab98323..d366d5b7e2 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) }