When client state files can't be retrieved after a job the code shouldn't fail. 
The os.remove call is already in a proper try-except that deals with the fact 
that the file may be missing, the read_from_file call can be moved into the 
same block.

Signed-off-by: John Admanski <[email protected]>

--- autotest/server/server_job.py       2010-04-12 12:28:51.000000000 -0700
+++ autotest/server/server_job.py       2010-04-12 12:28:51.000000000 -0700
@@ -1125,13 +1125,15 @@
         @param state_file A path to the state file from the client.
         """
         # update the on-disk state
-        self._state.read_from_file(state_path)
         try:
+            self._state.read_from_file(state_path)
             os.remove(state_path)
         except OSError, e:
             # ignore file-not-found errors
             if e.errno != errno.ENOENT:
                 raise
+            else:
+                logging.debug('Client state file %s not found', state_path)
 
         # update the sysinfo state
         if self._state.has('client', 'sysinfo'):
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to