fault/fm-api
Shuicheng Lin cca4dc0c54 Implement FaultAPIsV2 to distinguish fail and no data case
Current FaultAPIs (get_fault/get_faults/get_faults_by_id) cannot
distinguish error and no data case. None will be returned for both
case. To separate these two cases, and implement the code more as
pythonic way, FaultAPIsV2 is added, which will raise exception for
error case.
In order to separate the cases, the C functions called by API are
modified to return FALSE for error, and return None for no data.

Test:
Pass basic deploy test, and "fm alarm-*" cmd work as before.
Use fm_api_test.py/fm_api_v2_test.py to manual trigger API call,
confirm alarm could be created/get/deleted, and value is the same
as "fm alarm-list".
Modify fmManager to simulate error case, confirm exception is
generated for FaultAPIsV2, and behavior is not changed for
FaultAPIs.

Story: 2004859
Task: 29097

Change-Id: Ic1c0a15eb8dfec6c368099b096d6a158da0d3c77
Signed-off-by: Shuicheng Lin <shuicheng.lin@intel.com>
2019-03-05 20:14:49 +08:00
..
centos Implement FaultAPIsV2 to distinguish fail and no data case 2019-03-05 20:14:49 +08:00
fm_api Implement FaultAPIsV2 to distinguish fail and no data case 2019-03-05 20:14:49 +08:00
.gitignore StarlingX open source release updates 2018-05-31 07:36:00 -07:00
fm_api_test.py Implement FaultAPIsV2 to distinguish fail and no data case 2019-03-05 20:14:49 +08:00
fm_api_v2_test.py Implement FaultAPIsV2 to distinguish fail and no data case 2019-03-05 20:14:49 +08:00
LICENSE StarlingX open source release updates 2018-05-31 07:36:00 -07:00
PKG-INFO StarlingX open source release updates 2018-05-31 07:36:00 -07:00
setup.py StarlingX open source release updates 2018-05-31 07:36:00 -07:00