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
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)