incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1225413 - in /incubator/tashi/branches/stroucki-accounting/src/tashi: clustermanager/clustermanagerservice.py nodemanager/nodemanagerservice.py
Date Thu, 29 Dec 2011 02:34:11 GMT
Author: stroucki
Date: Thu Dec 29 02:34:10 2011
New Revision: 1225413

URL: http://svn.apache.org/viewvc?rev=1225413&view=rev
Log:
clustermanagerservice: fixes
nodemanagerservice: fixes

Modified:
    incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/clustermanagerservice.py
    incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/clustermanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/clustermanagerservice.py?rev=1225413&r1=1225412&r2=1225413&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/clustermanagerservice.py
(original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/clustermanager/clustermanagerservice.py
Thu Dec 29 02:34:10 2011
@@ -98,12 +98,12 @@ class ClusterManagerService(object):
 		hostText = None
 
 		if instance is not None:
-			instanceText = 'Instance(id %d host %d vmId %d user %d cores %d memory %d)' % (instance.id,
instance.hostId, instance.vmId, instance.userId, instance.cores, instance.memory))
+			instanceText = 'Instance(id %d host %d vmId %d user %d cores %d memory %d)' % (instance.id,
instance.hostId, instance.vmId, instance.userId, instance.cores, instance.memory)
 
 		if host is not None:
 			hostText = "Host(id %d memory %d cores %d)" % (host.id, host.memory, host.cores)
 
-		secondary = ','.join(hostText, instanceText)
+                secondary = ','.join(filter(None, (hostText, instanceText)))
 
 		line = "%s|%s|%s" % (now, text, secondary)
 

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py?rev=1225413&r1=1225412&r2=1225413&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py
(original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/nodemanagerservice.py
Thu Dec 29 02:34:10 2011
@@ -126,17 +126,17 @@ class NodeManagerService(object):
 
 
         def __ACCOUNT(self, text, instance=None, host=None):
-                now = self.__now()
+                now = time.time()
                 instanceText = None
                 hostText = None
 
                 if instance is not None:
-                        instanceText = 'Instance(id %d host %d vmId %d user %d cores %d memory
%d)' % (instance.id, instance.hostId, instance.vmId, instance.userId, instance.cores, instance.memory))
+                        instanceText = 'Instance(id %d host %d vmId %d user %d cores %d memory
%d)' % (instance.id, instance.hostId, instance.vmId, instance.userId, instance.cores, instance.memory)
 
                 if host is not None:
                         hostText = "Host(id %d memory %d cores %d)" % (host.id, host.memory,
host.cores)
 
-                secondary = ','.join(hostText, instanceText)
+                secondary = ','.join(filter(None, (hostText, instanceText)))
 
                 line = "%s|%s|%s" % (now, text, secondary)
 
@@ -217,7 +217,7 @@ class NodeManagerService(object):
                         
 		instance.state = cur
 
-		self._ACCOUNT("NM VM STATE CHANGE", instance=instance)
+		self.__ACCOUNT("NM VM STATE CHANGE", instance=instance)
 			      
 		newInst = Instance(d={'state':cur})
 		success = lambda: None



Mime
View raw message