Hi,

Both ErrorReport() and ErrorClear() APIs can be called for any component hosted anywhere. Since amfnd only maintains local components, component may not be found in its data base. A message should be sent to AMFD or AMFND should instantly read IMM database for validating the component.

I am ok, if this patch is pushed by documenting this limitation for both ErrorReport() and ErrorClear() APIs.


Thanks
Praveen

On 02-Aug-17 12:51 PM, Nguyen Luu wrote:
When called with a non-existing component name, saAmfComponentErrorClear_4
should return SA_AIS_ERR_NOT_EXIST instead of SA_AIS_ERR_BAD_OPERATION
as previously done.
---
  src/amf/amfnd/err.cc | 6 ++++--
  1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/amf/amfnd/err.cc b/src/amf/amfnd/err.cc
index e4cb9f0..65c54f5 100644
--- a/src/amf/amfnd/err.cc
+++ b/src/amf/amfnd/err.cc
@@ -269,9 +269,11 @@ uint32_t avnd_evt_ava_err_clear_evh(AVND_CB *cb, AVND_EVT 
*evt) {
    comp = avnd_compdb_rec_get(cb->compdb, 
Amf::to_string(&err_clear->comp_name));
/* determine the error code, if any */
-  if (!comp || !m_AVND_COMP_IS_REG(comp) ||
+  if (!comp) amf_rc = SA_AIS_ERR_NOT_EXIST;
+
+  if ((comp) && (!m_AVND_COMP_IS_REG(comp) ||
        (!m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp) &&
-       !m_AVND_COMP_TYPE_IS_PROXIED(comp)))
+       !m_AVND_COMP_TYPE_IS_PROXIED(comp))))
      amf_rc = SA_AIS_ERR_BAD_OPERATION;
if ((comp) && m_AVND_COMP_OPER_STATE_IS_ENABLED(comp))


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to