>>> Why not instead check the node's operational state for ENABLED?
I guess your comment is about the below lines: > > + if ((comp->su->su_on_node->node_state ==> AVD_AVND_STATE_PRESENT) || > > + (comp->su->su_on_node->node_state ==> > > AVD_AVND_STATE_NO_CONFIG) || > > + (comp->su->su_on_node->node_state ==> > > AVD_AVND_STATE_NCS_INIT)) > > + avd_comp_oper_state_set(comp,> SA_AMF_OPERATIONAL_ENABLED); Yes, we can do that. Is that any other review comment to address before I push it ? Thanks -Nagu > -----Original Message----- > From: Hans Feldt [mailto:[email protected]] > Sent: 17 December 2013 16:41 > To: Nagendra Kumar; Hans Nordebäck; Praveen Malviya > Cc: [email protected] > Subject: RE: [PATCH 1 of 1] amf: set comp oper state to enable when > corresponding node is present [#324] > > Why not instead check the node's operational state for ENABLED? > Would result in cleaner code. > /Hans > > > -----Original Message----- > > From: [email protected] [mailto:[email protected]] > > Sent: den 17 december 2013 11:36 > > To: Hans Feldt; Hans Nordebäck; [email protected] > > Cc: [email protected] > > Subject: [PATCH 1 of 1] amf: set comp oper state to enable when > corresponding node is present [#324] > > > > osaf/services/saf/amf/amfd/comp.cc | 5 +++++ > > osaf/services/saf/amf/amfd/ndfsm.cc | 7 +++++-- > > osaf/services/saf/amf/amfnd/compdb.cc | 7 ++----- > > 3 files changed, 12 insertions(+), 7 deletions(-) > > > > > > diff --git a/osaf/services/saf/amf/amfd/comp.cc > b/osaf/services/saf/amf/amfd/comp.cc > > --- a/osaf/services/saf/amf/amfd/comp.cc > > +++ b/osaf/services/saf/amf/amfd/comp.cc > > @@ -225,6 +225,11 @@ static void comp_add_to_model(AVD_COMP * > > comp->su->saAmfSUPreInstantiable = > static_cast<SaBoolT>(true); > > } > > > > + if ((comp->su->su_on_node->node_state == > AVD_AVND_STATE_PRESENT) || > > + (comp->su->su_on_node->node_state == > AVD_AVND_STATE_NO_CONFIG) || > > + (comp->su->su_on_node->node_state == > AVD_AVND_STATE_NCS_INIT)) > > + avd_comp_oper_state_set(comp, > SA_AMF_OPERATIONAL_ENABLED); > > + > > /* Set runtime cached attributes. */ > > avd_saImmOiRtObjectUpdate(&comp->su->name, > const_cast<SaImmAttrNameT>("saAmfSUPreInstantiable"), > > SA_IMM_ATTR_SAUINT32T, &comp->su- > >saAmfSUPreInstantiable); > > diff --git a/osaf/services/saf/amf/amfd/ndfsm.cc > b/osaf/services/saf/amf/amfd/ndfsm.cc > > --- a/osaf/services/saf/amf/amfd/ndfsm.cc > > +++ b/osaf/services/saf/amf/amfd/ndfsm.cc > > @@ -205,9 +205,12 @@ void avd_nd_ncs_su_assigned(AVD_CL_CB *c > > avd_node_oper_state_set(avnd, > SA_AMF_OPERATIONAL_ENABLED); > > > > /* Make application SUs operational state ENABLED */ > > - for (su = avnd->list_of_su; su != NULL; su = su- > >avnd_list_su_next) > > + for (su = avnd->list_of_su; su != NULL; su = su- > >avnd_list_su_next) { > > avd_su_oper_state_set(su, > SA_AMF_OPERATIONAL_ENABLED); > > - > > + AVD_COMP *comp; > > + for (comp = su->list_of_comp; comp; comp = comp- > >su_comp_next) > > + avd_comp_oper_state_set(comp, > SA_AMF_OPERATIONAL_ENABLED); > > + } > > /* We can now set the LEDS */ > > avd_snd_set_leds_msg(cb, avnd); > > > > diff --git a/osaf/services/saf/amf/amfnd/compdb.cc > b/osaf/services/saf/amf/amfnd/compdb.cc > > --- a/osaf/services/saf/amf/amfnd/compdb.cc > > +++ b/osaf/services/saf/amf/amfnd/compdb.cc > > @@ -1482,11 +1482,8 @@ static int comp_init(AVND_COMP *comp, co > > else > > cmd->timeout = comptype->saAmfCtDefClcCliTimeout; > > } > > - > > - if (m_AVND_COMP_TYPE_IS_PREINSTANTIABLE(comp)) > > - m_AVND_COMP_OPER_STATE_SET(comp, > SA_AMF_OPERATIONAL_DISABLED); > > - else > > - m_AVND_COMP_OPER_STATE_SET(comp, > SA_AMF_OPERATIONAL_ENABLED); > > + /* Set oper status to enable irrespective of comp category PI or NPI. */ > > + m_AVND_COMP_OPER_STATE_SET(comp, > SA_AMF_OPERATIONAL_ENABLED); > > > > /* Remove any previous environment variables */ > > if (comp->saAmfCompCmdEnv != NULL) { ------------------------------------------------------------------------------ CenturyLink Cloud: The Leader in Enterprise Cloud Services. Learn Why More Businesses Are Choosing CenturyLink Cloud For Critical Workloads, Development Environments & Everything In Between. Get a Quote or Start a Free Trial Today. http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opensaf-devel
