Bug 1729043

Summary: ipa-healthcheck command output is not indented by default.
Product: Red Hat Enterprise Linux 8 Reporter: Nikhil Dehadrai <ndehadra>
Component: ipa-healthcheckAssignee: Rob Crittenden <rcritten>
Status: CLOSED ERRATA QA Contact: ipa-qe <ipa-qe>
Severity: unspecified Docs Contact: Tomas Capek <tcapek>
Priority: unspecified    
Version: 8.1CC: abokovoy, fcami, ipa-maint, ksiddiqu, mpolovka, pcech, rcritten
Target Milestone: rcKeywords: TestCaseProvided
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ipa-healthcheck-0.4-1 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 15:43:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nikhil Dehadrai 2019-07-11 09:25:14 UTC
Description of problem:
ipa-healthcheck command output is not indented by default. As a result the output cannot be read correctly.

Version-Release number of selected component (if applicable):
ipa-healthcheck-0.2-3.module+el8.1.0+3389+a3c612fa.noarch

How reproducible:
Always

Steps to Reproduce:
1. Setup ipa master using RHEL 8.1 beta repo (in my case ipa-server-4.7.90.pre1-3.module+el8.1.0+3389+a3c612fa.x86_64)
2. Setup ipa-healthcheck on this system (# dnf -y install ipa-healthcheck)
3. Run ipa-healthcheck command
# ipa-healthcheck

Actual results:
ipa-healthcheck command output is not indented by default. As a result the output cannot be read correctly. 

[root@auto-hv-01-guest10 ~]# ipa-healthcheck --output-type json
[{"source": "ipahealthcheck.meta.services", "check": "certmonger", "severity": 0, "uuid": "c849492b-9f26-4683-a74c-aa5011d07143", "when": "20190711091157Z", "duration": "0.013412", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "dirsrv", "severity": 0, "uuid": "55c10acc-e22f-4dbb-b069-64f7fa58fb81", "when": "20190711091157Z", "duration": "0.010942", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "gssproxy", "severity": 0, "uuid": "7f09f059-6c57-4d72-9ef1-95b2744d1cea", "when": "20190711091157Z", "duration": "0.010635", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "httpd", "severity": 0, "uuid": "7c9fcc4c-00fe-4171-b5bd-0b56424cb1d7", "when": "20190711091157Z", "duration": "0.010448", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "krb5kdc", "severity": 0, "uuid": "4be3fe83-2bfd-4a0d-b630-65c7b5d6811f", "when": "20190711091157Z", "duration": "0.010611", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "named", "severity": 0, "uuid": "0268a7fd-f9b8-408d-86fc-f40680ae58c2", "when": "20190711091157Z", "duration": "0.010373", "kw": {"status": true}},

.............. Result Truncated


Expected results:
When ipa-healthcheck command is run by default, it should return the output in correct indentation so that it can be easy to interprete


Additional info:
Using command like #ipa-healthcheck --indent 4, the output was correctly indented.

[root@auto-hv-01-guest10 ~]# ipa-healthcheck --indent 4
[
    {
        "source": "ipahealthcheck.meta.services",
        "check": "certmonger",
        "severity": 0,
        "uuid": "55a8e32a-811c-4b25-bfb8-a8a8cc1b3aee",
        "when": "20190711092027Z",
        "duration": "0.013633",
        "kw": {
            "status": true
        }
    },
    {
        "source": "ipahealthcheck.meta.services",
        "check": "dirsrv",
        "severity": 0,
        "uuid": "2e91ba0c-109c-4753-8491-c488c665a647",
        "when": "20190711092027Z",
        "duration": "0.010911",
        "kw": {
            "status": true
        }
    },
.............. Result Truncated

Comment 1 Nikhil Dehadrai 2019-07-11 09:27:36 UTC
[root@auto-hv-01-guest10 ~]# ipa-healthcheck 
[{"source": "ipahealthcheck.meta.services", "check": "certmonger", "severity": 0, "uuid": "a546d785-39c7-465f-92cc-7d33e011fea0", "when": "20190711091057Z", "duration": "0.016557", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "dirsrv", "severity": 0, "uuid": "8332b20c-b850-4a97-815d-bcced8f65a75", "when": "20190711091057Z", "duration": "0.011666", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "gssproxy", "severity": 0, "uuid": "92979b28-c769-4ede-af34-1c23a2630c22", "when": "20190711091057Z", "duration": "0.010724", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "httpd", "severity": 0, "uuid": "a3831ac6-907b-46d5-983f-5d12ab73b505", "when": "20190711091057Z", "duration": "0.010349", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "krb5kdc", "severity": 0, "uuid": "adf66687-ea6d-46b6-97f8-8534dacb5d35", "when": "20190711091057Z", "duration": "0.010297", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "named", "severity": 0, "uuid": "b9641ba3-4a9a-4c43-b4d8-7a3f921d50e4", "when": "20190711091057Z", "duration": "0.011213", "kw": {"status": true}}, {"source": "ipahealthcheck.meta.services", "check": "pki_tomcatd", "severity": 0, "uuid": "b0677e59-36a9-42db-8974-dd49d97faf4f",

.............. Output Truncated

Comment 4 Rob Crittenden 2019-07-18 12:37:25 UTC
Fixed upstream in master: 02272ff39d76f1412483c5e3289564c93d196a03

When writing JSON to stdout the indention will be 2 unless overridden.

Comment 8 Rob Crittenden 2020-04-03 12:34:27 UTC
Upstream test case
master:
https://pagure.io/freeipa/c/f5f960ed2ab08208b52260ab2dbe99da500ee04e

Comment 9 François Cami 2020-04-03 16:51:29 UTC
Upstream test case
ipa-4-8:
https://pagure.io/freeipa/c/80fe55d78c8cb409290bb8dd9619cc1089080bb2

Comment 11 errata-xmlrpc 2020-04-28 15:43:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:1640