fix for new versions of SQLAlchemy.
Stephen Soltesz [Thu, 6 Oct 2011 23:26:31 +0000 (19:26 -0400)]
web/MonitorWeb/monitorweb/controllers.py
web/MonitorWeb/monitorweb/monitor_xmlrpc.py

index 68df2eb..c67f118 100644 (file)
@@ -387,7 +387,7 @@ class Root(controllers.RootController, MonitorXmlrpcServer, LocalExtensions):
        def nodeslow(self, filter='boot'):
                print "NODE------------------"
                print "befor-len: ", len( [ i for i in session] )
-               session.flush(); session.clear()
+               session.flush(); session.expunge_all()
                print "after-len: ", len( [ i for i in session] )
                fbquery = FindbadNodeRecord.get_all_latest()
                query = []
@@ -511,7 +511,7 @@ class Root(controllers.RootController, MonitorXmlrpcServer, LocalExtensions):
 
 
        def pre_view(self, **data):
-               session.flush(); session.clear()
+               session.flush(); session.expunge_all()
 
                loginbase=None
                loginbase_list=[]
@@ -612,7 +612,7 @@ class Root(controllers.RootController, MonitorXmlrpcServer, LocalExtensions):
        @expose(template="monitorweb.templates.pcuview")
        @exception_handler(nodeaction_handler,"isinstance(tg_exceptions,RuntimeError)")
        def pcuviewold(self, loginbase=None, pcuid=None, hostname=None, since=20, **data):
-               session.flush(); session.clear()
+               session.flush(); session.expunge_all()
                sitequery=[]
                pcuquery=[]
                nodequery=[]
@@ -729,7 +729,7 @@ class Root(controllers.RootController, MonitorXmlrpcServer, LocalExtensions):
        def pcu(self, filter='all'):
                print "PCUVIEW------------------"
                print "befor-len: ", len( [ i for i in session] )
-               session.flush(); session.clear()
+               session.flush(); session.expunge_all()
                print "after-len: ", len( [ i for i in session] )
                fbquery = FindbadPCURecord.get_all_latest()
                query = []
@@ -767,7 +767,7 @@ class Root(controllers.RootController, MonitorXmlrpcServer, LocalExtensions):
        def site(self, filter='all'):
                print "SITE------------------"
                print "befor-len: ", len( [ i for i in session] )
-               session.flush(); session.clear()
+               session.flush(); session.expunge_all()
                print "after-len: ", len( [ i for i in session] )
                filtercount = {'good' : 0, 'down': 0, 'online':0, 'offline' : 0, 'new' : 0, 'pending' : 0, 'all' : 0}
                fbquery = HistorySiteRecord.query.all()
index 2f46879..026a9ae 100644 (file)
@@ -98,7 +98,7 @@ class MonitorXmlrpcServer(object):
                        if method is None or not getattr(method, "exposed", False):
                                raise AssertionError("method does not exist")
 
-                       session.clear()
+                       session.expunge_all()
                        # Call the method, convert it into a 1-element tuple
                        # as expected by dumps                                     
                        response = method(*params)