Hi Lennart,

w.r.t the indentation, SMF code is mostly using tabs and spaces here and there. 
In this case, this function (and the whole file SmfUpgradeStep.cc) is using 
tabs.
That is why I had used tabs to not add to the confusion. 

Responding to Rafael separately.

Thanks,
Mathi.


> -----Original Message-----
> From: Lennart Lund [mailto:[email protected]]
> Sent: Wednesday, May 11, 2016 7:55 PM
> To: Mathivanan Naickan Palanivelu; Rafael Odzakow; Reddy Neelakanta
> Reddy Peddavandla
> Cc: [email protected]; Lennart Lund
> Subject: RE: [PATCH 1 of 1] smfd: choose the AU type with highest scope in
> merged procedure [#1810]
> 
> Ack with comments
> 
> Comments:
> Incorrect indentation
> "Old" comments not updated
> 
> Note: Also see important comments from Rafael
> 
> Thanks
> Lennart
> 
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]]
> > Sent: den 10 maj 2016 16:29
> > To: Rafael Odzakow; Lennart Lund; [email protected]
> > Cc: [email protected]
> > Subject: [PATCH 1 of 1] smfd: choose the AU type with highest scope in
> > merged procedure [#1810]
> >
> >  osaf/services/saf/smfsv/smfd/SmfUpgradeStep.cc |  70
> > ++++++++++++++++++++++++++
> >  1 files changed, 70 insertions(+), 0 deletions(-)
> >
> >
> > When SMF_MERGE_TO_SINGLE_STEP feature is enabled and the step
> requires
> > reboot, i.e. when saSmfBundleInstallOfflineScope or
> > saSmfBundleRemoveOfflineScope is set to SA_SMF_CMD_SCOPE_PLM_EE
> and
> > when smfSSAffectedNodesEnable is true then currently SMF uses the
> > first occurrence of the AU's actedOn entry and throws the following
> > error:
> > - A software bundle requires reboot but the AU is a SU This patch
> > changes this behaviour and chooses the AU/DU type that has the highest
> > scope  i.e. safAmfNode scope for enabling node reboot.
> > Therefore, If first entry is not of type safAmfNode, look for it in
> > the rest of the actedOn list.
> >  If not found in actedOn list, look in swAdd and swRemove bundles
> > accordingly to choose the scope.
> >
> > 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
> > @@ -31,6 +31,7 @@
> >  #include "SmfUpgradeStep.hh"
> >  #include "SmfCampaign.hh"
> >  #include "SmfUpgradeProcedure.hh"
> > +#include "SmfUpgradeCampaign.hh"
> >  #include "SmfUpgradeMethod.hh"
> >  #include "SmfProcedureThread.hh"
> >  #include "SmfStepState.hh"
> > @@ -1362,13 +1363,82 @@ SmfUpgradeStep::calculateStepType()
> >     //If rolling upgrade check the first AU of the step
> >     std::string className;
> >     std::string firstAuDu;
> > +   std::list < unitNameAndState >::const_iterator unitIt;
> > +
> >     if (this->getProcedure()->getUpgradeMethod()-
> > >getUpgradeMethod() == SA_SMF_SINGLE_STEP) {
> >             //Single step
> >             //Try the activation unit list, if empty try the deactivation 
> > unit
> > list
> >             if (!this->getActivationUnitList().empty()) {
> >                     firstAuDu = this-
> > >getActivationUnitList().front().name;
> > +                   // When
> > SMF_MERGE_TO_SINGLE_STEP feature is enabled and the step requires
> > reboot,
> > +                   // i.e. when
> > saSmfBundleInstallOfflineScope or saSmfBundleRemoveOfflineScope is
> > +                   // set to
> > SA_SMF_CMD_SCOPE_PLM_EE and when smfSSAffectedNodesEnable is
> true then
> > +                   // Choose the type with the
> > highest scope i.e. safAmfNode for enabling node reboot.
> > +                   // Therefore, If first entry is not of
> > type safAmfNode, look for it in the rest of the actedOn list.
> > +                   // Note: ignore matches for comp,
> > su since node is a part of their DNs.
> > +                   if (rebootNeeded &&
> > !(firstAuDu.find("safAmfNode") == 0) &&
> > +
> >     SmfCampaignThread::instance()->campaign()-
> > >getUpgradeCampaign()->getProcExecutionMode()
> > +
> >     == SMF_MERGE_TO_SINGLE_STEP) {
> > +                   for (unitIt = this-
> > >getActivationUnitList().begin();
> > +                           unitIt != this-
> > >getActivationUnitList().end(); ++unitIt) {
> > +
> >     if(!((*unitIt).name.find("safComp") == 0) &&
> > !((*unitIt).name.find("safSu") == 0)
> > +
> >                             &&
> > (*unitIt).name.find("safAmfNode") == 0){
> > +
> >     firstAuDu = unitIt->name;
> > +
> >     break;
> > +                           }
> > +                   }
> > +                   if (!firstAuDu.find("safAmfNode")
> > == 0) {
> > +                           // There is no
> > safAmfNode in actedOn list, now walk through swAdd Bundles list.
> > +                           std::list <
> > SmfBundleRef >::const_iterator bundleit;
> > +                           for (bundleit = m_swAddList.begin(); bundleit !=
> > m_swAddList.end(); ++bundleit) {
> > +
> >     std::list<SmfPlmExecEnv>::const_iterator ee;
> > +                                   for (ee = bundleit-
> > >getPlmExecEnvList().begin();
> > +
> >             ee != bundleit->getPlmExecEnvList().end();
> > ee++) {
> > +                                           std::string const& amfnode = ee-
> > >getAmfNode();
> > +                                           if (amfnode.length() != 0) {
> > +
> >             firstAuDu = amfnode;
> > +
> >             break;
> > +                                           }
> > +                                   }
> > +                                   if
> > (firstAuDu.find("safAmfNode"))
> > +
> >     break;
> > +                           } //End - walk
> > through swAdd bundle list
> > +                   }
> > +                   } //End - Look ahead in the lists of
> > actedOn and swAdd bundles to find for safAmfNode
> >             } else if (!this-
> > >getDeactivationUnitList().empty()) {
> >                     firstAuDu = this-
> > >getDeactivationUnitList().front().name;
> > +                   // When
> > SMF_MERGE_TO_SINGLE_STEP feature is enabled and reboot is enabled,
> > +                   // choose the highest of the DU
> > types for letting reboot happen.
> > +                   //If first entry is not of type
> > safAmfNode, find it in the rest of the list.
> > +                   if (rebootNeeded &&
> > !(firstAuDu.find("safAmfNode") == 0) &&
> > +
> >     SmfCampaignThread::instance()->campaign()-
> > >getUpgradeCampaign()->getProcExecutionMode()
> > +
> >     == SMF_MERGE_TO_SINGLE_STEP) {
> > +                   for (unitIt = this-
> > >getDeactivationUnitList().begin();
> > +                           unitIt != this-
> > >getDeactivationUnitList().end(); ++unitIt) {
> > +
> >     if(!((*unitIt).name.find("safComp") == 0) &&
> > !((*unitIt).name.find("safSu") == 0)
> > +
> >                             &&
> > (*unitIt).name.find("safAmfNode") == 0){
> > +
> >     firstAuDu = unitIt->name;
> > +
> >     break;
> > +                           }
> > +                   }
> > +                        if (!firstAuDu.find("safAmfNode") == 0) {
> > +                                // There is no safAmfNode in actedOn
> > +list, now walk
> > through swRemove Bundles list.
> > +                                std::list < SmfBundleRef >::const_iterator 
> > bundleit;
> > +                                for (bundleit =
> > + m_swRemoveList.begin(); bundleit !=
> > m_swRemoveList.end(); ++bundleit) {
> > +                                        
> > std::list<SmfPlmExecEnv>::const_iterator ee;
> > +                                        for (ee = 
> > bundleit->getPlmExecEnvList().begin();
> > +                                                        ee !=
> > + bundleit->getPlmExecEnvList().end();
> > ee++) {
> > +                                                std::string const& amfnode 
> > = ee->getAmfNode();
> > +                                                if (amfnode.length() != 0) 
> > {
> > +                                                        firstAuDu = 
> > amfnode;
> > +                                                        break;
> > +                                                }
> > +                                        }
> > +                                   if
> > (firstAuDu.find("safAmfNode"))
> > +
> >     break;
> > +                                } //End - walk through swRemove bundle list
> > +                        }
> > +                   } //End - Look ahead in the lists of
> > actedOn and swRemove bundles to find for safAmfNode
> >             } else {
> >                     //No activation/deactivation, just SW installation
> >                     className = "SaAmfNode";

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to