Example #1
0
 def save(self, pBackend=None, **kwargs):
     if not pBackend:
         pBackend = self._persistenceBackend
     if not kwargs:
         kwargs2 = self._persistenceBackendParameters
     else:
         kwargs2 = kwargs
     PersistenceEngine.save(self, pBackend, **kwargs2)
Example #2
0
 def loadOrGenerate(
     name,
     resolverMappings,
     defaultParser,
     defaultPersistence,
     defaultPersistenceFlag,
     pType=False,
     uuid=None,
     **kwargs
 ):
     try:
         return PersistenceEngine.load(name, defaultPersistence, resolverMappings, defaultParser, **kwargs)
     except ZeroPolicyObjectsReturned:
         RuleTable.logger.warning("Unable to load RuleTable, generating a new one")
         return RuleTable(
             name, resolverMappings, defaultParser, defaultPersistence, defaultPersistenceFlag, pType, uuid, **kwargs
         )
     except MultiplePolicyObjectsReturned:
         RuleTable.logger.warning("Unable to load a single RuleTable, asking the user")
         raise MultiplePolicyObjectsReturned
     except Exception as e:
         RuleTable.logger.error("Unable to load RuleTable. Exception: %s" % str(e))
Example #3
0
 def delete(tableID, defaultPersistence):
     return PersistenceEngine.delete(tableID, defaultPersistence)
Example #4
0
 def loadAll(name, defaultPersistence):
     return PersistenceEngine.loadAll(name, defaultPersistence)
Example #5
0
 def load(name, resolverMappings, pBackend, **kwargs):
     return PersistenceEngine.load(name, pBackend, resolverMappings, **kwargs)