-
- def make_map(self):
- m = Mapper()
- m.connect('', controller='getroot')
- m.connect('acl', controller='getmachines')
- m.connect('acl/:machine', controller='getacl')
- m.connect('conf', controller='getconf')
- return m
-
- def getroot(self, **kw):
- return ['acl', 'conf']
-
+
+ def make_map(self):
+ m = Mapper()
+ m.connect('', controller='getroot')
+ m.connect('acl', controller='getmachines')
+ m.connect('acl/:machine', controller='getacl')
+ m.connect('conf', controller='getconf')
+ return m
+
+ def recache(self):
+ if time() - self.lasttime > 15:
+ self.lasttime = time()
+ database.clear_cache()
+ self.machines = dict((machine.name, machine) for machine in database.session.query(database.Machine).all())
+
+ def getroot(self, **kw):
+ return ['acl', 'conf']
+