Bug 1322776 - [API] Inconsistent value type of clusters/CLUSTERID/summary - storageusage
Summary: [API] Inconsistent value type of clusters/CLUSTERID/summary - storageusage
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Storage Console
Classification: Red Hat Storage
Component: core
Version: 2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 2
Assignee: anmol babu
QA Contact: sds-qe-bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-31 10:39 UTC by Daniel Horák
Modified: 2016-08-23 19:48 UTC (History)
1 user (show)

Fixed In Version: rhscon-core-0.0.17-1.el7scon.x86_64.rpm
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-23 19:48:57 UTC
Embargoed:


Attachments (Terms of Use)
api_inconsistent_value_type.sh - reproducer script (685 bytes, application/x-shellscript)
2016-03-31 10:39 UTC, Daniel Horák
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Gerrithub.io 274871 0 None None None 2016-05-06 08:44:12 UTC
Red Hat Product Errata RHEA-2016:1754 0 normal SHIPPED_LIVE New packages: Red Hat Storage Console 2.0 2017-04-18 19:09:06 UTC

Description Daniel Horák 2016-03-31 10:39:28 UTC
Created attachment 1142144 [details]
api_inconsistent_value_type.sh - reproducer script

Description of problem:
  API response to GET clusters/CLUSTERID/summary have inconsistent type of "storageusage". If there is no storage created in the cluster, it will return null. If there is some storage created in the cluster, it will return list.

Version-Release number of selected component (if applicable):
  rhscon-ceph-0.0.8-1.el7.x86_64
  rhscon-core-0.0.11-1.el7.x86_64
  rhscon-ui-0.0.25-1.el7.noarch

How reproducible:
  100%

Steps to Reproduce:
1. Install and configure USM cluster.
2. Accept few nodes and create ceph cluster.
3. Use api_inconsistent_value_type.sh script (in attachments) as reproducer (first parameter is USM server, second parameter is CLUSTERID), 
4. Check the value of "storageusage".
  # bash api_inconsistent_value_type.sh USM-SERVER CLUSTER-ID
5. Create storage in the cluster.
6. Check the value of "storageusage" (same as in step 4).

Actual results:
  In the step 4, it will return null:
    "storageusage":null
  In the step 6, it will return list:
    "storageusage":[{"name":"TestStorage01","usage":{"used":145,"total":12821381265,"percentused":1.130923392753503e-06}}]

Expected results:
  It should always return value in the same type. In this case, it should return empty list in step 4.

Additional info:
  If you have "jq" installed, you can uncomment line 13 in the api_inconsistent_value_type.sh script and it will print just the value of the storageusagve key.

Comment 3 Daniel Horák 2016-06-24 11:30:17 UTC
Testerd and VERIFIED on:
  ceph-ansible-1.0.5-22.el7scon.noarch
  ceph-installer-1.0.12-2.el7scon.noarch
  rhscon-ceph-0.0.26-1.el7scon.x86_64
  rhscon-core-0.0.26-1.el7scon.x86_64
  rhscon-core-selinux-0.0.26-1.el7scon.noarch
  rhscon-ui-0.0.41-1.el7scon.noarch

>> VERIFIED

Comment 5 errata-xmlrpc 2016-08-23 19:48:57 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-2016:1754


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