replace host -> name
This commit is contained in:
		
							parent
							
								
									876b3901a5
								
							
						
					
					
						commit
						9ac5c80f73
					
				| 
						 | 
				
			
			@ -28,7 +28,7 @@ def get_active_problems() -> dict:
 | 
			
		|||
                event_ids.append(problem["eventid"])
 | 
			
		||||
 | 
			
		||||
        events = api.event.get(
 | 
			
		||||
            selectHosts=["host"],
 | 
			
		||||
            selectHosts=["name"],
 | 
			
		||||
            eventids=event_ids,
 | 
			
		||||
            output=[
 | 
			
		||||
                "eventid",
 | 
			
		||||
| 
						 | 
				
			
			@ -38,7 +38,7 @@ def get_active_problems() -> dict:
 | 
			
		|||
        )
 | 
			
		||||
        events_dict = {"event_ids": []}
 | 
			
		||||
        for event in events:
 | 
			
		||||
            event["host"] = event.pop("hosts", None)[0]["host"]
 | 
			
		||||
            event["host"] = event.pop("hosts", None)[0]["name"]
 | 
			
		||||
            events_dict[event["eventid"]] = event
 | 
			
		||||
            events_dict["event_ids"].append(event["eventid"])
 | 
			
		||||
        return events_dict
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue