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 2012/02/16 03:32:44 UTC

svn commit: r1244839 - in /incubator/tashi/branches/stroucki-slotsbug: ./ src/tashi/client/tashi-client.py

Author: stroucki
Date: Thu Feb 16 03:32:44 2012
New Revision: 1244839

URL: http://svn.apache.org/viewvc?rev=1244839&view=rev
Log:
tashi-client: test fix to calculate slots correctly if some hosts happen
              to be overprovisioned

Added:
    incubator/tashi/branches/stroucki-slotsbug/
      - copied from r1242468, incubator/tashi/trunk/
Modified:
    incubator/tashi/branches/stroucki-slotsbug/src/tashi/client/tashi-client.py

Modified: incubator/tashi/branches/stroucki-slotsbug/src/tashi/client/tashi-client.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-slotsbug/src/tashi/client/tashi-client.py?rev=1244839&r1=1242468&r2=1244839&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-slotsbug/src/tashi/client/tashi-client.py (original)
+++ incubator/tashi/branches/stroucki-slotsbug/src/tashi/client/tashi-client.py Thu Feb 16 03:32:44 2012
@@ -166,7 +166,7 @@ def getSlots(cores, memory):
 			continue
 		countbycores = int((h.cores - h.usedCores) / cores)
 		countbymemory = int((h.memory - h.usedMemory) / memory)
-		count += min(countbycores, countbymemory)
+		count += min(0, min(countbycores, countbymemory))
 
 	print "%d" % (count),
 	print (lambda:"instances", lambda:"instance")[count == 1](),