mantle/platform: fix unit failure basic check
This fixes calling `checkSystemdUnitFailures` using the output from the
`systemctl` command with `activating` substituted instead of `failed`.
Fixes ("Add kola to detect when a systemd unit is stuck
activating").
@@ -524,6 +524,11 @@ func CheckMachine(ctx context.Context, m Machine) error {
if err != nil {
return fmt.Errorf("failed to query systemd for failed units: %s: %v: %s", out, err, stderr)
}
+ err = checkSystemdUnitFailures(string(out), distribution)
+ if err != nil {
+ return err
+ }
+
// Ensure no systemd units stuck in activating state
out, stderr, err = m.SSH(activatingUnitsCmd)
if err != nil {
@@ -533,11 +538,6 @@ func CheckMachine(ctx context.Context, m Machine) error {
if err != nil {
return err
}
-
- err = checkSystemdUnitFailures(string(out), distribution)
- if err != nil {
- return err
- }
}
return ctx.Err()
