-
Notifications
You must be signed in to change notification settings - Fork 136
fix: (migrated PR 4094): fix socket.gethostbyaddr(ip) error when no reverse DNS available. #4095
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
Conversation
For ip addresses without reverse DNS, socket.gethostbyaddr(ip) will fail. We can simply use ip address for hostname display.
for more information, see https://pre-commit.ci
Reviewer's GuideHostname resolution logic updated to use the raw IP for non-local addresses, removing the reverse DNS lookup call to prevent socket.gethostbyaddr failures. Class diagram for updated hostname resolution logicclassDiagram
class MapdlGrpc {
- _hostname
__init__(ip)
}
%% Before: _hostname set via socket.gethostbyaddr(ip) for non-local IPs
%% After: _hostname set to ip directly for non-local IPs (no reverse DNS lookup)
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Thanks for opening a Pull Request. If you want to perform a review write a comment saying: @ansys-reviewer-bot review |
@yeguang-xue I took advantage of your PR to do a small refactoring. I hope you dont mind. Good job! |
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (84.61%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #4095 +/- ##
==========================================
- Coverage 91.82% 91.80% -0.03%
==========================================
Files 187 187
Lines 15033 15041 +8
==========================================
+ Hits 13804 13808 +4
- Misses 1229 1233 +4 🚀 New features to boost your workflow:
|
I do not care about coverage for this case. @pyansys-ci-bot LGTM. |
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.
This PR is a mirror pull request created from Fix socket.gethostbyaddr(ip) error when no reverse DNS available. to allow the code to access PyMAPDL CICD secrets.
Check the original PR made by @yeguang-xue for more details.
Closes #4094
Original pull request
Fix socket.gethostbyaddr(ip) error when no reverse DNS available.
Description
For ip addresses without reverse DNS, socket.gethostbyaddr(ip) will fail. We can simply use ip address for hostname display.
Issue linked
Please mention the issue number or describe the problem this pull request addresses.
Checklist
draft
if it is not ready to be reviewed yet.feat: adding new MAPDL command
)Summary by Sourcery
Bug Fixes: