[result] Result message should be in consistent format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
juju-verify |
Triaged
|
Low
|
Unassigned |
Bug Description
We should standardize the format of the results messages of checks,
as some use different format, what cause output to be little bit
confusing.
A good example are results from checking the nova-compute unit.
```bash
$ juju-verify reboot --unit nova-compute/0
Checks:
[OK] check_affected_
[OK] check_has_
[OK] Unit nova-compute/0 is running 0 VMs.
[OK] Empty Availability Zone check passed.
Overall result: OK (All checks passed)
```
There are three types of messages:
1. "<exact-
2. custom message without mentioning which check it comes
from (although this is obvious)
3. "<check-
I think it should be standardized and mentioned in the contribution.
Changed in juju-verify: | |
status: | New → Triaged |
importance: | Undecided → Low |
This is a good point, the output should be consistent.
In my opinion, adding whether the check passed or failed as part of the message body is superfluous, as the message is already pre-faced with [OK], [WARN] or [FAIL].
I also don't think that using underscores in output intended for humans is desired.
I think that good message format should contain:
- Clear indication of pass/fail
- Which unit/app/machine is the message related to. (This one is tricky, as not all checks have same scope. Some are per-unit, some are application wide and some are concerned with the machine)
- Human readable check name
- Optional additional info. I think that additional info is really only needed in case of failure, checks that pass do not need to burden user with info about why they passed.
What do you think about following format?
[<success> ][<unit_ or_app_ name>] <human readable check name> - <optional info>
Example:
[OK] [Machine 0] Check Affected Machines
[OK] [nova-compute] Availability Zone check
[FAIL] [nova-compute/0] Running VMs check - Unit has 2 running VMs