diff --git a/cmd/mesh-controller/module_health.go b/cmd/mesh-controller/module_health.go index 41aab43c..29cb01c2 100644 --- a/cmd/mesh-controller/module_health.go +++ b/cmd/mesh-controller/module_health.go @@ -389,6 +389,10 @@ func moduleUnhealthyObservation(module, node string, rs []inventory.ResourceHeal // reasonWords is why a resource is unhealthy, as a person reads it. func reasonWords(r inventory.ResourceHealth) string { + // An account waiting for a new login (ADR 0252) is said in the mesh's words, not the engine's. + if r.Kind == link.KindAccount && strings.HasPrefix(r.Reason, link.ReasonRelogin) { + return fmt.Sprintf("waits for a new login of %s, which is in the group and logged in before it was", accountOf(r)) + } switch r.Reason { case "restarting": return fmt.Sprintf("keeps restarting (%d restart(s) counted)", r.Restarts) @@ -453,11 +457,11 @@ func personWait(module, machine string, rs []inventory.ResourceHealth) (string, } } said := fmt.Sprintf("relogin needed on %s: %s waits for a new login of %s, which is in its group and whose "+ - "running session began before it was; log out of every session and in again, or reboot", machine, module, + "login began before it was; log out of %[1]s completely and log in again, or restart it", machine, module, strings.Join(accounts, ", ")) if len(units) > 0 { sort.Strings(units) - said += fmt.Sprintf(" (until then %s cannot run in that session)", strings.Join(units, ", ")) + said += fmt.Sprintf(" (until then %s cannot run)", strings.Join(units, ", ")) } return said, true } diff --git a/cmd/mesh-controller/plain_words.go b/cmd/mesh-controller/plain_words.go index 91d2e053..ca3ca1c2 100644 --- a/cmd/mesh-controller/plain_words.go +++ b/cmd/mesh-controller/plain_words.go @@ -661,7 +661,7 @@ func moduleNeeds(node string, rs []inventory.ResourceHealth) (string, []conditio var actions []conditions.Action for _, r := range rs { if strings.Contains(r.Reason, "relogin needed") { - return fmt.Sprintf("log out of every session on %s and log in again.", node), nil + return fmt.Sprintf("log out of %s completely and log in again, or restart it.", node), nil } if r.Kind == link.KindUnit && len(actions) < 2 { scope := "system" diff --git a/cmd/mesh-controller/plain_words_test.go b/cmd/mesh-controller/plain_words_test.go index 8a2c653a..8fb6616e 100644 --- a/cmd/mesh-controller/plain_words_test.go +++ b/cmd/mesh-controller/plain_words_test.go @@ -102,9 +102,12 @@ func TestAModuleUnhealthyOffersARestartOfItsService(t *testing.T) { // An account waiting for a new login (ADR 0252) asks for the login, which no button can give. o = moduleUnhealthyObservation("openrazer", "g14", []inventory.ResourceHealth{{Kind: "account", Resource: "operator-in-group", Target: "jochen", Reason: "relogin needed: the account is in the group"}}) - if o.Needs != "log out of every session on g14 and log in again." || len(o.Actions) != 0 { + if o.Needs != "log out of g14 completely and log in again, or restart it." || len(o.Actions) != 0 { t.Errorf("relogin: %q %+v", o.Needs, o.Actions) } + if strings.Contains(o.Summary, "session") || !strings.Contains(o.Summary, "waits for a new login of jochen") { + t.Errorf("relogin summary: %q", o.Summary) + } } // **Failed units on a machine**: "shanks's service manager is degraded: 3 failed unit(s) no module places —