incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1235573 - in /incubator/tashi/branches: stablefix/src/tashi/client/tashi-client.py stroucki-accounting/src/tashi/client/tashi-client.py
Date Wed, 25 Jan 2012 00:31:48 GMT
Author: stroucki
Date: Wed Jan 25 00:31:47 2012
New Revision: 1235573

URL: http://svn.apache.org/viewvc?rev=1235573&view=rev
Log:
only consider up and normal state hosts when calculating capacity

Modified:
    incubator/tashi/branches/stablefix/src/tashi/client/tashi-client.py
    incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py

Modified: incubator/tashi/branches/stablefix/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stablefix/src/tashi/client/tashi-client.py?rev=1235573&r1=1235572&r2=1235573&view=diff
==============================================================================
--- incubator/tashi/branches/stablefix/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/branches/stablefix/src/tashi/client/tashi-client.py Wed Jan 25 00:31:47
2012
@@ -162,6 +162,8 @@ def getSlots(cores, memory):
 	count = 0
 
 	for h in hosts:
+		if h.up is False or h.state != HostState.Normal:
+			continue
 		countbycores = int((h.cores - h.usedCores) / cores)
 		countbymemory = int((h.memory - h.usedMemory) / memory)
 		count += min(countbycores, countbymemory)

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py?rev=1235573&r1=1235572&r2=1235573&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/client/tashi-client.py Wed Jan
25 00:31:47 2012
@@ -162,6 +162,8 @@ def getSlots(cores, memory):
 	count = 0
 
 	for h in hosts:
+		if h.up is False or h.state != HostState.Normal:
+			continue
 		countbycores = int((h.cores - h.usedCores) / cores)
 		countbymemory = int((h.memory - h.usedMemory) / memory)
 		count += min(countbycores, countbymemory)



Mime
View raw message