Tweaks the error when scripts are disabled.

This will hopefully help people self-serve if they upgrade without accounting
for this.
This commit is contained in:
James Phillips 2017-07-19 22:15:04 -07:00
parent a7842dc688
commit a0867b5d49
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
2 changed files with 2 additions and 2 deletions

View File

@ -1629,7 +1629,7 @@ func (a *Agent) AddCheck(check *structs.HealthCheck, chkType *structs.CheckType,
} }
if chkType.IsScript() && !a.config.EnableScriptChecks { 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")
} }
} }

View File

@ -822,7 +822,7 @@ func TestAgent_AddCheck_ExecDisable(t *testing.T) {
Interval: 15 * time.Second, Interval: 15 * time.Second,
} }
err := a.AddCheck(health, chk, false, "") 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) t.Fatalf("err: %v", err)
} }