示例#1
0
 def conflictMissing(self, conflict):
     """
     Conflict missing (Resolved by another one)
     Remove conflict in original object and notify to clients
     """
     conflict.getFirstObject().updateResolved(conflict)
     notifier.conflictUpdate(-1)
示例#2
0
 def addUpdate(self, old_object, new_object, command_id):
     # Returns True if the update was resolved without user interaction
     try:
         mergeAction = old_object.addUpdate(new_object, command_id)
         if mergeAction:
             if old_object not in self.objects_with_updates:
                 self.objects_with_updates.append(old_object)
             notifier.conflictUpdate(1)
             return False
     except Exception as ex:
         api.devlog("(%s).addUpdate(%s, %s) - failed" %
                    (self, old_object, new_object))
         return False
     self.mappers_manager.update(old_object, command_id)
     notifier.editHost(old_object)
     return True
示例#3
0
 def removeConflictsByObject(self, obj):
     if obj in self.objects_with_updates:
         self.objects_with_updates.remove(obj)
     notifier.conflictUpdate(-len(obj.getUpdates()))
示例#4
0
 def resolveConflict(self, conflict, kwargs):
     if self.__edit(conflict.getFirstObject(), **kwargs):
         conflict.getFirstObject().updateResolved(conflict)
         notifier.conflictUpdate(-1)