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 | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/amf/amfnd/err.cc b/src/amf/amfnd/err.cc
index e4cb9f0..3da4363 100644
--- a/src/amf/amfnd/err.cc
+++ b/src/amf/amfnd/err.cc
@@ -2,6 +2,7 @@
*
* (C) Copyright 2008 The OpenSAF Foundation
* Copyright (C) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (C) 2017 Ericsson AB. All Rights Reserved.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -13,6 +14,7 @@
* licensing terms.
*
* Author(s): Emerson Network Power
+ * Ericsson
*
*/
@@ -269,9 +271,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))
--
2.7.4
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel