incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1370610 - /incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py
Date Wed, 08 Aug 2012 00:29:09 GMT
Author: stroucki
Date: Wed Aug  8 00:29:08 2012
New Revision: 1370610

URL: http://svn.apache.org/viewvc?rev=1370610&view=rev
Log:
sql: be specific about catching type error, and raise it up to find where this is called from

Modified:
    incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py

Modified: incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py
URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py?rev=1370610&r1=1370609&r2=1370610&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py Wed Aug  8 00:29:08 2012
@@ -260,8 +260,9 @@ class SQL(DataInterface):
 	def getHost(self, in_id):
 		try:
 			_id = int(in_id)
-		except:
+		except TypeError:
 			self.log.exception("Argument to getHost was not integer: %s" % in_id)
+			raise
 
 		cur = self.executeStatement("SELECT * FROM hosts WHERE id = %d" % _id)
 		r = cur.fetchone()
@@ -282,8 +283,9 @@ class SQL(DataInterface):
 	def getInstance(self, in_id):
 		try:
 			_id = int(in_id)
-		except:
+		except TypeError:
 			self.log.exception("Argument to getInstance was not integer: %s" % in_id)
+			raise
 
 		cur = self.executeStatement("SELECT * FROM instances WHERE id = %d" % (_id))
 		# XXXstroucki should only return one row.



Mime
View raw message