You are viewing a plain text version of this content. The canonical link for it is here.
Posted to tashi-commits@incubator.apache.org by st...@apache.org on 2010/09/27 23:28:22 UTC

svn commit: r1001963 - /incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py

Author: stroucki
Date: Mon Sep 27 23:28:22 2010
New Revision: 1001963

URL: http://svn.apache.org/viewvc?rev=1001963&view=rev
Log:
when using sql for cm backend, decayed and up are shown as integers,
   not boolean

keep info on what database engine is being used

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=1001963&r1=1001962&r2=1001963&view=diff
==============================================================================
--- incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py (original)
+++ incubator/tashi/trunk/src/tashi/clustermanager/data/sql.py Mon Sep 27 23:28:22 2010
@@ -30,9 +30,11 @@ class SQL(DataInterface):
 		self.log = logging.getLogger(__name__)
 		if (self.uri.startswith("sqlite://")):
 			import sqlite
+			self.dbengine = "sqlite"
 			self.conn = sqlite.connect(self.uri[9:], autocommit=1)
 		elif (self.uri.startswith("mysql://")):
 			import MySQLdb
+			self.dbengine = "mysql"
 			uri = self.uri[8:]
 			(user, _, hostdb) = stringPartition(uri, '@')
 			(host, _, db) = stringPartition(hostdb, '/')
@@ -113,6 +115,8 @@ class SQL(DataInterface):
 		for e in range(0, len(self.hostOrder)):
 			h.__dict__[self.hostOrder[e]] = l[e]
 		h.state = int(h.state)
+		h.up = boolean(h.up)
+		h.decayed = boolean(h.decayed)
 		return h
 	
 	def registerInstance(self, instance):