Project

General

Profile

Bug #20694

GET /api/hosts/:id shows errata_counts as null is errata count is zero instead of 0

Added by Daniel Lobato Garcia over 4 years ago. Updated almost 4 years ago.

Status:
Rejected
Priority:
Normal
Category:
Errata Management
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1482502

Description of problem:
GET /api/hosts/:id shows errata_counts as integer if errata count > 0 and shows as null instead of 0 otherwise.

GET https://sat6.com/api/v2/hosts/37 {
"id":37,
...
"content_facet_attributes": {
"errata_counts": {
"security": 1,
"bugfix": null,
"enhancement": null,
"total": 1

Version-Release number of selected component (if applicable):
Sat 6.3 Snap 11:
  • satellite-6.3.0-16.0.beta.el7sat.noarch
  • katello-3.4.4-2.el7sat.noarch
  • foreman-1.15.3-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
To see only null values, omit steps 2 and 3.

1. Create and register content host
2. Add and synchronize repository with available errata
3. Install on the content host package that has applicable errata in the repository.
4. Check errata counts via GET /api/hosts/:id

Actual results:
Errata count is integer if it is not zero and null oterwise.
On UI it is displayed as 0.

Expected results:
errata_counts field should contain 0.

Additional info:

History

#1 Updated by Eric Helms over 4 years ago

  • Subject changed from GET /api/hosts/:id shows errata_counts as null is errata count is zero instead of 0 to GET /api/hosts/:id shows errata_counts as null is errata count is zero instead of 0
  • Legacy Backlogs Release (now unused) set to 250

#2 Updated by Justin Sherrill over 4 years ago

  • Status changed from New to Assigned
  • Assignee set to Justin Sherrill

#3 Updated by Justin Sherrill over 4 years ago

  • Status changed from Assigned to Rejected
  • Legacy Backlogs Release (now unused) changed from 250 to 166

Also available in: Atom PDF