Skip to content

Commit

Permalink
Merge pull request #19 from trento-project/improve-callback-handling
Browse files Browse the repository at this point in the history
Added more debugging when multi hosts are discovered in the callback
  • Loading branch information
Steven Stringer authored Jul 15, 2022
2 parents 3d5b6f7 + fafc824 commit 3580953
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/PutFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ func (cbl *CallbackListener) HandleResult(CheckID string, wg *sync.WaitGroup) {
case clbk.Event == "execution_completed":
/*We only expect one host, make sure that's all we have*/
if len(clbk.Payload.Hosts) != 1 {
log.Fatal("More than 1 host in the returned payload. This is unexpected")
log.Error("More than 1 host in the returned payload. This is unexpected. Dumping JSON")
clbk.Print()
log.Fatalf("Expected only one host in the callback but got %d. Rodent doesn't currently handle this", len(clbk.Payload.Hosts))
}
/*Ensure the host was reachable*/
if !clbk.Payload.Hosts[0].Reachable {
Expand Down

0 comments on commit 3580953

Please sign in to comment.