server_job.run should only remove the uncollected_logs file if it created it. The method may be used recursively, so the call that creates it is the one responsible for removing it.
Signed-off-by: John Admanski <[email protected]> --- autotest/server/server_job.py 2010-03-15 15:36:32.000000000 -0700 +++ autotest/server/server_job.py 2010-03-15 15:36:32.000000000 -0700 @@ -379,6 +379,7 @@ control_file_dir=None, only_collect_crashinfo=False): # for a normal job, make sure the uncollected logs file exists # for a crashinfo-only run it should already exist, bail out otherwise + created_uncollected_logs = False if self.resultdir and not os.path.exists(self._uncollected_log_file): if only_collect_crashinfo: # if this is a crashinfo-only run, and there were no existing @@ -390,6 +391,7 @@ log_file = open(self._uncollected_log_file, "w") pickle.dump([], log_file) log_file.close() + created_uncollected_logs = True # use a copy so changes don't affect the original dictionary namespace = namespace.copy() @@ -476,7 +478,7 @@ self._execute_code(CRASHINFO_CONTROL_FILE, namespace) else: self._execute_code(CRASHDUMPS_CONTROL_FILE, namespace) - if self._uncollected_log_file: + if self._uncollected_log_file and created_uncollected_logs: os.remove(self._uncollected_log_file) self.disable_external_logging() if cleanup and machines: _______________________________________________ Autotest mailing list [email protected] http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
