Bug 1389263 - [3.4] the summary of json report should include total/ok number after certificate expiry check
Summary: [3.4] the summary of json report should include total/ok number after certifi...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Installer
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: 3.4.z
Assignee: Tim Bielawa
QA Contact: liujia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-10-27 10:04 UTC by liujia
Modified: 2017-03-06 16:37 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Feature: Total OK/Checked certificates are included in openshift_certificate_expiry role JSON check results. Reason: Increased visibility and easier checking for admins. Result: "Total" and "OK" counts are always included in JSON check results.
Clone Of:
Environment:
Last Closed: 2017-03-06 16:37:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:0448 0 normal SHIPPED_LIVE Important: ansible and openshift-ansible security and bug fix update 2017-03-06 21:36:25 UTC

Description liujia 2016-10-27 10:04:31 UTC
Description of problem:

Run a playbook with openshift_certificate_expiry role to check certs with json report generated, the report's summary part has only expired&warning numbers but not total numbers and 'ok' numbers. It is not convenient for user to catch the check result.

<--snip-->
"summary": {
    "expired": 0,
    "warning": 0
  }
<--snip-->

So QE suggested to add them to help user quickly know how many certs have been checked just like what is be output in html report:

Checked 14 total certificates. Expired/Warning/OK: 0/0/14. Warning window: 30 days 

Version-Release number of selected component (if applicable):
openshift-ansible-roles-3.4.12-1.git.0.0b5efd2.el7.noarch


How reproducible:
always

Steps to Reproduce:
1.Wrote a playbook to run role openshift_certificate_expiry.
cat playbook.yml
---
- name: Check cert expirys
  hosts: all
  become: yes
  gather_facts: no
  vars:
    openshift_certificate_expiry_show_all: yes
    openshift_certificate_expiry_generate_html_report: yes
    openshift_certificate_expiry_save_json_results: yes
  roles:
    - role: openshift_certificate_expiry

2.It will generate html and json report in default directory.

Actual results:
<--snip-->
"summary": {
    "expired": 0,
    "warning": 0
  }
<--snip-->

Expected results:
Json report should include total/ok number like following:
<--snip-->
"summary": {
    "total": 14
    "expired": 0,
    "warning": 0,
    "ok":14
  }
<--snip-->

Additional info:

Comment 1 Tim Bielawa 2016-12-12 21:41:03 UTC
Was working on a patch for this on GitHub:

https://github.com/openshift/openshift-ansible/pull/2829

Comment 2 Tim Bielawa 2016-12-19 18:01:30 UTC
Patch has been merged into master.

Comment 4 liujia 2017-02-07 08:00:27 UTC
Version:
atomic-openshift-utils-3.4.56-1.git.0.7ba9968.el7.noarch

Steps:
1. Install ocp3.4
2. Wrote a playbook to run role openshift_certificate_expiry.
3. Check result is right and total/ok numbers are added into json report now
<snip>
  },
  "summary": {
    "expired": 0,
    "ok": 14,
    "total": 14,
    "warning": 0
  }
<snip>

Bug has been fixed, change status.

Comment 6 errata-xmlrpc 2017-03-06 16:37:09 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/RHSA-2017:0448


Note You need to log in before you can comment on or make changes to this bug.