Skip to content

Commit

Permalink
Oops, needs to be in module
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbASF committed Jan 9, 2024
1 parent 48ebc95 commit 861a38d
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions lib/whimsy/asf/status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,22 @@ def self.updates_disallowed_reason

nil
end
end

def self.currentIP # intended for CLI testing
Resolv::DNS.open do |rs|
begin
@currentIP ||= rs.getaddress(hostname) # local as IP; should not change during a run
rescue Resolv::ResolvError => e # allow this to fail on a test node
raise unless testnode?
$stderr.puts "WARNING: Failed to resolve local IP address: #{e}"
def self.currentIP # intended for CLI testing
Resolv::DNS.open do |rs|
begin
@currentIP ||= rs.getaddress(hostname) # local as IP; should not change during a run
rescue Resolv::ResolvError => e # allow this to fail on a test node
raise unless testnode?
$stderr.puts "WARNING: Failed to resolve local IP address: #{e}"
end
end
end
end

def self.activeIP # intended for CLI testing
Resolv::DNS.open.getaddress(ACTIVE_HOSTNAME)

def self.activeIP # intended for CLI testing
Resolv::DNS.open.getaddress(ACTIVE_HOSTNAME)
end

end

# for debugging purposes
Expand Down

0 comments on commit 861a38d

Please sign in to comment.