Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
foreman_wds
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
foreman_wds
Commits
bbf50574
Verified
Commit
bbf50574
authored
4 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Use resolv instead of ipsocket to get WDS address
parent
ff7b3136
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/models/wds_server.rb
+3
-3
3 additions, 3 deletions
app/models/wds_server.rb
with
3 additions
and
3 deletions
app/models/wds_server.rb
+
3
−
3
View file @
bbf50574
...
...
@@ -111,9 +111,9 @@ class WdsServer < ApplicationRecord
end
def
next_server_ip
IPSocket
.
getaddress
URI
(
url
).
host
rescue
SocketError
::
Rails
.
logger
.
info
"Failed to look up IP of WDS server
#{
name
}
"
Resolv
.
getaddress
es
(
URI
(
url
).
host
).
select
{
|
str
|
IPAddr
.
new
(
str
).
ipv4?
}.
first
rescue
Resolv
::
ResolvError
=>
e
::
Rails
.
logger
.
info
"Failed to look up IP of WDS server
#{
name
}
.
#{
e
.
class
}
:
#{
e
}
"
nil
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment