Author: nunofsantos
Date: 2009-01-26 18:36:56 -0500 (Mon, 26 Jan 2009)
New Revision: 3073
Modified:
mgmt/trunk/mint/python/mint/__init__.py
Log:
handle exception from Postgresql when the DB is stopped, and properly terminate
threads/subprocs
Modified: mgmt/trunk/mint/python/mint/__init__.py
===================================================================
--- mgmt/trunk/mint/python/mint/__init__.py 2009-01-26 12:23:05 UTC (rev 3072)
+++ mgmt/trunk/mint/python/mint/__init__.py 2009-01-26 23:36:56 UTC (rev 3073)
@@ -17,6 +17,7 @@
from qmf.console import ClassKey
from util import *
from time import sleep
+from psycopg2 import OperationalError
log = logging.getLogger("mint")
@@ -562,6 +563,10 @@
break
self.do_run()
+ except OperationalError, e:
+ log.exception(e)
+ if str(e).find("server closed the connection unexpectedly") >= 0:
+ sys.exit()
except Exception, e:
log.exception(e)
Show replies by date