Skip to content

Commit

Permalink
If no service available, delete host (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mir Shahriar authored and tamalsaha committed Mar 6, 2018
1 parent eeae273 commit 0194570
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/icinga/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (h *commonHost) DeleteIcingaHost(kh IcingaHost) error {
return errors.FromErr(err).WithMessage("Can't get Icinga service").Err()
}

if len(respService.Results) <= 1 {
if len(respService.Results) == 0 {
resp := h.IcingaClient.Objects().Hosts("").Delete([]string{}, in).Params(param).Do()
if resp.Err != nil {
return errors.FromErr(err).WithMessage("Can't delete Icinga host").Err()
Expand Down

0 comments on commit 0194570

Please sign in to comment.