Commits

Anonymous committed a864455

fixex #15 - replace time.clock() for time.time()

git-svn-id: https://pysphere.googlecode.com/svn/trunk@7593908643-0a7e-a946-f69b-c8c46af5c9d1

Comments (0)

Files changed (2)

pysphere/vi_task.py

         
         if not isinstance(states, list):
             states = [states]
-        start_time = time.clock()
+        start_time = time.time()
         while True:
             cur_state = self.get_state()
             if cur_state in states:
                 return cur_state
 
             if timeout > 0:
-                if (time.clock() - start_time) > timeout:
+                if (time.time() - start_time) > timeout:
                     raise VIException("Timed out waiting for task state.", 
                                       FaultTypes.TIME_OUT)
 

pysphere/vi_virtual_machine.py

         """Waits for the VMWare tools to be running in the guest. Or for the
         timeout in seconds to expire. If timed out a VIException is thrown"""
         timeout = abs(int(timeout))
-        start_time = time.clock()
+        start_time = time.time()
         while True:
             cur_state = self.get_tools_status()
             if cur_state in [ToolsStatus.RUNNING, ToolsStatus.RUNNING_OLD]:
                 return True
 
-            if (time.clock() - start_time) > timeout:
+            if (time.time() - start_time) > timeout:
                 raise VIException(
                               "Timed out waiting for VMware Tools to be ready.",
                               FaultTypes.TIME_OUT)