mirror of
				https://github.com/ARM-software/workload-automation.git
				synced 2025-11-04 00:52:08 +00:00 
			
		
		
		
	framework/output: handle missing/corrupt result files.
Do not explode if a result file for a job is missing when loading a RunOutput. Specify job status as "UNKNOWN" and add the exception from attempting to load the file to the events.
This commit is contained in:
		
				
					committed by
					
						
						Marc Bonnici
					
				
			
			
				
	
			
			
			
						parent
						
							d616d30ee1
						
					
				
				
					commit
					c87d016025
				
			@@ -64,8 +64,14 @@ class Output(object):
 | 
			
		||||
        self.events = []
 | 
			
		||||
 | 
			
		||||
    def reload(self):
 | 
			
		||||
        pod = read_pod(self.resultfile)
 | 
			
		||||
        self.result = Result.from_pod(pod)
 | 
			
		||||
        try:
 | 
			
		||||
            pod = read_pod(self.resultfile)
 | 
			
		||||
            self.result = Result.from_pod(pod)
 | 
			
		||||
        except Exception as e:
 | 
			
		||||
            self.result = Result()
 | 
			
		||||
            self.result.status = Status.UNKNOWN
 | 
			
		||||
            self.add_event(str(e))
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    def write_result(self):
 | 
			
		||||
        write_pod(self.result.to_pod(), self.resultfile)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user