incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1229894 - in /incubator/tashi/branches/stroucki-accounting/src/tashi: clustermanager/data/sql.py util.py
Date Wed, 11 Jan 2012 05:18:57 GMT
Author: stroucki
Date: Wed Jan 11 05:18:57 2012
New Revision: 1229894

URL: http://svn.apache.org/viewvc?rev=1229894&view=rev
Log:
util.py: remove initialization of obj, will override locals
sql.py: ValueException has disappeared along the way, replace with TashiException

Modified:
    incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/data/sql.py
    incubator/tashi/branches/stroucki-accounting/src/tashi/util.py

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/data/sql.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/data/sql.py?rev=1229894&r1=1229893&r2=1229894&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/data/sql.py (original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/data/sql.py Wed
Jan 11 05:18:57 2012
@@ -19,7 +19,7 @@ import logging
 import threading
 # XXXstroucki getImages needs os?
 import os
-from tashi.rpycservices.rpyctypes import Errors, Network, Host, User, Instance, TashiException,
LocalImages, DiskConfiguration, NetworkConfiguration, ValueException
+from tashi.rpycservices.rpyctypes import Errors, Network, Host, User, Instance, TashiException,
LocalImages, DiskConfiguration, NetworkConfiguration
 from tashi.clustermanager.data.datainterface import DataInterface
 from tashi.util import stringPartition, boolean, instantiateImplementation, humanReadable
 
@@ -43,7 +43,7 @@ class SQL(DataInterface):
 			self.password = self.config.get('SQL', 'password')
 			self.conn = MySQLdb.connect(host=host, user=user, passwd=self.password, db=db)
 		else:
-			raise ValueException, 'Unknown SQL database engine by URI: %s' % (self.uri)
+			raise TashiException, 'Unknown SQL database engine by URI: %s' % (self.uri)
 
 		self.instanceOrder = ['id', 'vmId', 'hostId', 'decayed', 'state', 'userId', 'name', 'cores',
'memory', 'disks', 'nics', 'hints']
 		self.hostOrder = ['id', 'name', 'up', 'decayed', 'state', 'memory', 'cores', 'version']
@@ -317,7 +317,7 @@ class SQL(DataInterface):
 		for r in res:
 			if r[1] == hostname:
 				id = r[0]
-				print "Host %s already registered, update will be done" % id
+				self.log.warning("Host %s already registered, update will be done" % id)
 				s = ""
 				host = Host(d={'id': id, 'up': 0, 'decayed': 0, 'state': 1, 'name': hostname, 'memory':memory,
'cores': cores, 'version':version})
 				l = self.makeHostList(host)

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/util.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/util.py?rev=1229894&r1=1229893&r2=1229894&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/util.py (original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/util.py Wed Jan 11 05:18:57 2012
@@ -181,7 +181,6 @@ def boolean(value):
 def instantiateImplementation(className, *args):
 	"""Create an instance of an object with the given class name and list 
 	   of args to __init__"""
-	obj = None
 	if (className.rfind(".") != -1):
 		package = className[:className.rfind(".")]
 		cmd = "import %s\n" % (package)



Mime
View raw message