osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc |  23 ++++++++++++++++++-----
 1 files changed, 18 insertions(+), 5 deletions(-)


Make the SmfAdminOperation class able to handle an all unit list that
contains a mix of all types of units e.i SU, Node and Component.
Ignore unit types that are not compatible with the requested operation

diff --git a/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc 
b/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
--- a/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
+++ b/osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc
@@ -3046,11 +3046,14 @@ bool SmfAdminOperation::restart()
 
        m_errno = SA_AIS_OK;
        for (auto& unit : *m_allUnits) {
-               adminOperation(SA_AMF_ADMIN_RESTART, unit.name);
-               rc = isRestartError(m_errno);
-               TRACE("\tais_rc '%s'", saf_error(m_errno));
-               if (rc == false)
-                       break;
+               if (unit.name.find("safComp") != std::string::npos) {
+                       // Only if the unit is a component
+                       adminOperation(SA_AMF_ADMIN_RESTART, unit.name);
+                       rc = isRestartError(m_errno);
+                       TRACE("\tais_rc '%s'", saf_error(m_errno));
+                       if (rc == false)
+                               break;
+               }
        }
 
        done:
@@ -3199,6 +3202,7 @@ bool SmfAdminOperation::isRestartError(S
 }
 
 /// Return false if Fail. m_ais_errno is set
+/// Only SU and Node
 ///
 bool SmfAdminOperation::saveInitAndCurrentStateForAllUnits()
 {
@@ -3206,6 +3210,10 @@ bool SmfAdminOperation::saveInitAndCurre
        bool rc = true;
 
        for (auto& unit : *m_allUnits) {
+               if (unit.name.find("safComp") != std::string::npos) {
+                       // A component has no admin state
+                       continue;
+               }
                unit.initState = getAdminState(unit.name);
                unit.currentState = unit.initState;
                if (m_errno != SA_AIS_OK) {
@@ -3221,6 +3229,7 @@ bool SmfAdminOperation::saveInitAndCurre
 }
 
 /// Return false if Fail. m_ais_errno is set
+/// Only SU and Node
 ///
 bool SmfAdminOperation::saveCurrentStateForAllUnits()
 {
@@ -3228,6 +3237,10 @@ bool SmfAdminOperation::saveCurrentState
        bool rc = true;
 
        for (auto& unit : *m_allUnits) {
+               if (unit.name.find("safComp") != std::string::npos) {
+                       // A component has no admin state
+                       continue;
+               }
                unit.currentState = getAdminState(unit.name);
                if (m_errno != SA_AIS_OK) {
                        LOG_NO("%s: getAdminStateForUnit() Fail %s",

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to