Skip to content

Fix ping check with bad float conversion - #818

Merged
clamoriniere merged 1 commit into
masterfrom
clamoriniere/fix-ping-check
Mar 4, 2021
Merged

Fix ping check with bad float conversion#818
clamoriniere merged 1 commit into
masterfrom
clamoriniere/fix-ping-check

Conversation

@clamoriniere

@clamoriniere clamoriniere commented Mar 4, 2021

Copy link
Copy Markdown
Contributor

What does this PR do?

the ping check casts the timeout parameter to float.

this result in running an invalid ping command

2021-03-04 20:25:47 UTC | CORE | DEBUG | (pkg/collector/python/datadog_agent.go:126 in LogMessage) | ping:4b1a3ca7e11de8de | (ping.py:44) | Running: ping -c 1 -W 4.0 localhost
which yields an error
$ ping -c 1 -W 4.0 localhost
ping: invalid value (`4.0' near `.0')

unfortunately the type casting is hardcoded in the check code.

I have tested on linux (debian), Darwin and Windows and it seams ok to use int instead

Motivation

What inspired you to submit this pull request?

Review checklist

  • PR has a meaningful title or PR has the no-changelog label attached
  • Feature or bugfix has tests
  • Git history is clean
  • If PR impacts documentation, docs team has been notified or an issue has been opened on the documentation repo

Additional Notes

Anything else we should know when reviewing?

@clamoriniere
clamoriniere merged commit c065177 into master Mar 4, 2021
@clamoriniere
clamoriniere deleted the clamoriniere/fix-ping-check branch March 4, 2021 21:00
eliadeini pushed a commit to eliadeini/integrations-extras that referenced this pull request Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants