예제 #1
0
파일: client.py 프로젝트: maximerobin/Ufwi
    def setFusion(self, fusion, ruleset=None):
        self.fusion = fusion
        if self.mode == 'CLI':
            return self.fusion

        updates = Updates(
            Update('resources', 'update', '*'),
            Update('user_groups', 'update', '*'),
            Update('acls-ipv4', 'update', '*'),
            Update('acls-ipv6', 'update', '*'),
            Update('nats', 'update', '*'),
        )
        result = {'updates': updates.createTuple()}
        if ruleset:
            result['undoState'] = ruleset.undoState()
        return result
예제 #2
0
파일: fusion.py 프로젝트: maximerobin/Ufwi
 def setPhysicalObject(self, generic, physical_object, action, add_updates):
     old_physical = generic.physical_object
     if old_physical is physical_object:
         return
     if action:
         if add_updates:
             updates = Updates(Update(generic.update_domain, "update", generic.id))
             for ref in generic.references:
                 updates.addUpdate(Update(ref.update_domain, 'update', ref.id))
         else:
             updates = Updates()
         set_physical = Action(
             ActionHandler(updates, self._setPhysicalObject, generic, physical_object),
             ActionHandler(updates, self._setPhysicalObject, generic, generic.physical_object))
         action.executeAndChain(set_physical)
     else:
         self._setPhysicalObject(generic, physical_object)