nfv client shows raw REST results for 500 errors

Bug #1996796 reported by Al Bailey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Al Bailey

Bug Description

Brief Description
-----------------
When "sw-manager <some strategy> apply" receives a 500 error, the CLI shows a mess of raw REST results.
This issue is purely cosmetic but should be cleaned up.
there are 2 print statements in the rest_api.py for nfv_client that should be removed.

Severity
--------
Minor

Steps to Reproduce
------------------
sw-manager kube-rootca-update-strategy create
sw-manager kube-rootca-update-strategy apply
( then apply a second time after it has completed or failed)
sw-manager kube-rootca-update-strategy apply

Expected Behavior
------------------
Should not show a mess

Actual Behavior
----------------
 sw-manager kube-rootca-update-strategy apply
Rest-API status=500, POST, http://192.168.204.2:4545/api/orchestration/kube-rootca-update/strategy/actions, headers={'Content-Type': 'application/json', 'X-User': 'admin', 'X-Tenant': 'admin', 'X-User-Domain-Name': 'Default', 'X-Auth-Token': 'gAAAAABjdSoXwtpkom3PvHAZ85V-lHCjfUdabsfR17vx0DJ8JYLVxUEkpI2TXhPiIrcdW0EbIFdRVwKOHop8o-s2KqAkD4lokTGCGgUeGXnuGFtxQDKoXBFhAY7GVpLgQXnSruJ8e9WZuLAOlF7LfYYXzY4vZ5P5R0D5ovMxvLKGFKy1vM3i-O8'}, payload={"action": "apply-all"}, response=b'{"faultcode": "Server", "faultstring": "The server has either erred or is incapable of performing the requested operation.", "debuginfo": null}'
HTTP Error 500: Internal Server Error

Reproducibility
---------------
100% If the strategy is in a scenario where it will report a 500 failure (like there are active alarms, or the strategy has already been applied)

System Configuration
--------------------
AIO-SX

Branch/Pull Time/Commit
-----------------------
Nov 16 2022

Last Pass
---------
N/A

Timestamp/Logs
--------------
See the logs above

Test Activity
-------------
Developer Testing

Workaround
----------
None. it is cosmetic.

Al Bailey (albailey1974)
Changed in starlingx:
assignee: nobody → Al Bailey (albailey1974)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nfv (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/nfv/+/864779

Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nfv (master)

Reviewed: https://review.opendev.org/c/starlingx/nfv/+/864779
Committed: https://opendev.org/starlingx/nfv/commit/a0f06e0b1043d8e666b4288cd9c96fbd0a956066
Submitter: "Zuul (22348)"
Branch: master

commit a0f06e0b1043d8e666b4288cd9c96fbd0a956066
Author: Al Bailey <email address hidden>
Date: Wed Nov 16 18:43:55 2022 +0000

    Do not show raw results for failed nfv CLI calls

    The nfv_client rest_api was displaying raw REST
    API results when a CLI command received a 500 error.

    The printing of debug information has been removed
    and the 'reason' field in the HTTPError is now being
    displayed.

    Closes-Bug: #1996796

    Signed-off-by: Al Bailey <email address hidden>
    Change-Id: I244453cd2126923d5ad30ab38fb1796551ab8aed

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.8.0 stx.nfv
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.