clear_fault in FaultAPIsV2 throw exception when clear non-exist alarm

Bug #1821112 reported by Lin Shuicheng
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Lin Shuicheng

Bug Description

Brief Description
-----------------
I call clear_fault against an alarmID/entity path that there is no alarm raised for but instead of just returning False or None ; it generates an exception.

Severity
--------
Provide the severity of the defect.
Minor

Steps to Reproduce
------------------
Write a script to use clear_fault API in FaultAPIsV2, and call it with an alarmID/entity path that there is no alarm.

Expected Behavior
------------------
API should return None or False. Exception should be raised only if there is operaion failure (e.g. because the API can’t connect to fmmanager).

Actual Behavior
----------------
Exception is raised.

Reproducibility
---------------
<Reproducible/Intermittent>
100%

System Configuration
--------------------
Standard configuration.

Branch/Pull Time/Commit
-----------------------
Branch and the time when code was pulled or git commit

Timestamp/Logs
--------------

Changed in starlingx:
status: New → Confirmed
assignee: nobody → Lin Shuicheng (shuicheng)
Ghada Khalil (gkhalil)
tags: added: stx.2019.05 stx.fault
Revision history for this message
Ghada Khalil (gkhalil) wrote :

Marking as release gating; related to SB: https://storyboard.openstack.org/#!/story/2004859 which provides a new API for FM

Changed in starlingx:
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to stx-fault (master)

Fix proposed to branch: master
Review: https://review.openstack.org/647302

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

Reviewed: https://review.openstack.org/647302
Committed: https://git.openstack.org/cgit/openstack/stx-fault/commit/?id=622ad8d87cf14136b230b4bac945927f23d5596d
Submitter: Zuul
Branch: master

commit 622ad8d87cf14136b230b4bac945927f23d5596d
Author: Shuicheng Lin <email address hidden>
Date: Mon Mar 25 20:11:43 2019 +0800

    Fix clear_fault/clear_all in FaultAPIsV2 raise exception when alarm is
    not found

    For the all 6 APIs in FaultAPIsV2, will treat alarm non-exist as normal
    case, and exception will not be raised. Exception is raised only if
    there is operation failure, such as fmclient fail to connect fmManager,
    failure in memory allocation, failure in internal structure parse, etc.

    Test:
    Run each 6 APIs from FaultAPIs and FaultAPIsV2 with below case:
    1. with correct alarm id
    2. with wrong alarm id
    3. with fmManager cannot be connected (Modify fmManager listen port to
       simulate it)
    Confirm FaultAPIs's behavior is not changed.
    And FaultAPIsV2 raises exception for operation failure only.
    Check Events Suppression function in horizon GUI, it works correctly.

    Closes-Bug: 1821112

    Change-Id: I8ba122b19964613d90e9d0bf4a25134ff60e5c19
    Signed-off-by: Shuicheng Lin <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ken Young (kenyis)
tags: added: stx.2.0
removed: stx.2019.05
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.