Example #1
0
 def __mergeIndependentUpdates(self, oRemoteConfData):
     # return S_ERROR( "AutoMerge is still not finished. Meanwhile... why don't you get the newest conf and update from there?" )
     # Get all the CFGs
     curSrvCFG = gConfigurationData.getRemoteCFG().clone()
     curCliCFG = oRemoteConfData.getRemoteCFG().clone()
     result = self.__getPreviousCFG(oRemoteConfData)
     if not result["OK"]:
         return result
     prevCliCFG = result["Value"]
     # Try to merge curCli with curSrv. To do so we check the updates from
     # prevCli -> curSrv VS prevCli -> curCli
     prevCliToCurCliModList = prevCliCFG.getModifications(curCliCFG)
     prevCliToCurSrvModList = prevCliCFG.getModifications(curSrvCFG)
     result = self._checkConflictsInModifications(prevCliToCurSrvModList, prevCliToCurCliModList)
     if not result["OK"]:
         return S_ERROR("Cannot AutoMerge: %s" % result["Message"])
     # Merge!
     result = curSrvCFG.applyModifications(prevCliToCurCliModList)
     if not result["OK"]:
         return result
     return S_OK(curSrvCFG)
Example #2
0
 def __mergeIndependentUpdates(self, oRemoteConfData):
     #return S_ERROR( "AutoMerge is still not finished. Meanwhile... why don't you get the newest conf and update from there?" )
     #Get all the CFGs
     curSrvCFG = gConfigurationData.getRemoteCFG().clone()
     curCliCFG = oRemoteConfData.getRemoteCFG().clone()
     result = self.__getPreviousCFG(oRemoteConfData)
     if not result['OK']:
         return result
     prevCliCFG = result['Value']
     #Try to merge curCli with curSrv. To do so we check the updates from
     # prevCli -> curSrv VS prevCli -> curCli
     prevCliToCurCliModList = prevCliCFG.getModifications(curCliCFG)
     prevCliToCurSrvModList = prevCliCFG.getModifications(curSrvCFG)
     result = self._checkConflictsInModifications(prevCliToCurSrvModList,
                                                  prevCliToCurCliModList)
     if not result['OK']:
         return S_ERROR("Cannot AutoMerge: %s" % result['Message'])
     #Merge!
     result = curSrvCFG.applyModifications(prevCliToCurCliModList)
     if not result['OK']:
         return result
     return S_OK(curSrvCFG)