incubator-tashi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strou...@apache.org
Subject svn commit: r1229850 - in /incubator/tashi/branches/stroucki-accounting/src/tashi: accounting/accountingservice.py nodemanager/vmcontrol/qemu.py
Date Wed, 11 Jan 2012 01:31:46 GMT
Author: stroucki
Date: Wed Jan 11 01:31:46 2012
New Revision: 1229850

URL: http://svn.apache.org/viewvc?rev=1229850&view=rev
Log:
qemu: change order of state change during instantiation so that NM will handle it, rather
than ignore it
accountingservice: lamely handle non-existent sleep time for polling VMs

Modified:
    incubator/tashi/branches/stroucki-accounting/src/tashi/accounting/accountingservice.py
    incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/accounting/accountingservice.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/accounting/accountingservice.py?rev=1229850&r1=1229849&r2=1229850&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/accounting/accountingservice.py
(original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/accounting/accountingservice.py
Wed Jan 11 01:31:46 2012
@@ -34,9 +34,16 @@ class AccountingService(object):
 
 	    self.config = config
 
-	    self.pollsleep = self.config.get("AccountingService", "pollSleep")
-	    if self.pollsleep is None:
-		    self.pollsleep = 600
+	    self.pollSleep = None
+
+	    # XXXstroucki new python has fallback values
+	    try:
+		    self.pollSleep = self.config.getint("AccountingService", "pollSleep")
+	    except:
+		    pass
+
+	    if self.pollSleep is None:
+		    self.pollSleep = 600
 
             self.cm = createClient(config)
             threading.Thread(target=self.__start).start()
@@ -58,4 +65,4 @@ class AccountingService(object):
 
                         
                 # wait to do the next iteration
-                time.sleep(self.pollsleep)
+                time.sleep(self.pollSleep)

Modified: incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py
URL: http://svn.apache.org/viewvc/incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py?rev=1229850&r1=1229849&r2=1229850&view=diff
==============================================================================
--- incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py (original)
+++ incubator/tashi/branches/stroucki-accounting/src/tashi/nodemanager/vmcontrol/qemu.py Wed
Jan 11 01:31:46 2012
@@ -612,12 +612,12 @@ class Qemu(VmControlInterface):
 			child = self.__getChildFromPid(vmId)
 			self.__getPtyInfo(child, False)
 			child.cmd = cmd
+			self.nm.createInstance(child.instance)
+			self.nm.vmStateChange(vmId, None, InstanceState.Running)
 			# XXXstroucki Should make sure Running state is saved
 			# otherwise on restart it will appear as Activating
 			# until we update the state in __matchSystemPids
 			child.instance.state = InstanceState.Running
-			self.nm.createInstance(child.instance)
-			self.nm.vmStateChange(vmId, None, InstanceState.Running)
 			self.__saveChildInfo(child)
 			return vmId
 		except:



Mime
View raw message