-
-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update discover single to handle hostnames #539
Conversation
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
ec98015
to
15b5c85
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never realized that this wasn't already working as initializing device instances manually just worked(tm) 👍
15b5c85
to
9cf2e81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks! 🥇
While looking at merged PR #528 I noticed some users were using hostnames to add their devices and the current discover_single will not work with hostnames. This PR does a simple DNS lookup using getaddrinfo if a hostname is used so that it can match to the datagram response ip.
According to the getaddrinfo docs dns lookup only happens if node parameter is a hostname: