Skip to content

Ensure network check doesn't fail on importing fcntl on Windows#8459

Merged
florimondmanca merged 7 commits into
masterfrom
slavek.kabrda/network-fcntl-fix
Jan 26, 2021
Merged

Ensure network check doesn't fail on importing fcntl on Windows#8459
florimondmanca merged 7 commits into
masterfrom
slavek.kabrda/network-fcntl-fix

Conversation

@bkabrda

@bkabrda bkabrda commented Jan 26, 2021

Copy link
Copy Markdown

What does this PR do?

fcntl is not importable on Windows, so we have to create a try/except clause for its import so that the check itself is importable on Windows.

Motivation

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@bkabrda
bkabrda requested review from a team as code owners January 26, 2021 12:42
@ghost ghost added the integration/network label Jan 26, 2021
@bkabrda
bkabrda force-pushed the slavek.kabrda/network-fcntl-fix branch from 37fd5c1 to bb44f35 Compare January 26, 2021 12:53
@bkabrda bkabrda changed the title Ensure we don't fail on importing fcntl on Windows Ensure network check doesn't fail on importing fcntl on Windows Jan 26, 2021
@ghost ghost added the dev/testing label Jan 26, 2021
@coignetp coignetp mentioned this pull request Jan 26, 2021
4 tasks

@coignetp coignetp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: since the integration is not yet refactored to parse the configuration in the constructor, the exception will be raised in the check method. I think it's fine for now.

Comment thread network/datadog_checks/network/network.py Outdated
@florimondmanca
florimondmanca merged commit 025cde6 into master Jan 26, 2021
@florimondmanca
florimondmanca deleted the slavek.kabrda/network-fcntl-fix branch January 26, 2021 14:43
@florimondmanca florimondmanca mentioned this pull request Jan 26, 2021
4 tasks
florimondmanca pushed a commit that referenced this pull request Jan 26, 2021
* Ensure network check doesn't fail on importing fcntl on Windows

* test

* Add network to windows ci

* Remove extra blank line

* Update test-all-checks

* Fix display name

* Update network/datadog_checks/network/network.py

Co-authored-by: Paul <[email protected]>

Co-authored-by: Paul Coignet <[email protected]>
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.

4 participants