summaryrefslogtreecommitdiff
path: root/lib/custodian/protocoltest/dns.rb
diff options
context:
space:
mode:
authorSteve Kemp <steve@steve.org.uk>2013-05-15 16:20:41 +0100
committerSteve Kemp <steve@steve.org.uk>2013-05-15 16:20:41 +0100
commit19fd7ac18460e3e5206496cf5f6bf629aff3e2a9 (patch)
treead4425c0e823b501b74b1c38a217e3c1dac011ba /lib/custodian/protocoltest/dns.rb
parent4b3f47175b109c6da2fb738d05b037d80b0b87f4 (diff)
Honour the global timeout period.
The global configuration file, /etc/custodian/custodian.cfg, has a timeout=XX setting in it. Until now we've ignored it and used a fixed timeout of 20/30 seconds. Now we fully honour the specified value.
Diffstat (limited to 'lib/custodian/protocoltest/dns.rb')
-rw-r--r--lib/custodian/protocoltest/dns.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/custodian/protocoltest/dns.rb b/lib/custodian/protocoltest/dns.rb
index 4053747..daa0c4d 100644
--- a/lib/custodian/protocoltest/dns.rb
+++ b/lib/custodian/protocoltest/dns.rb
@@ -1,3 +1,4 @@
+require 'custodian/settings'
require 'resolv'
#
@@ -94,9 +95,15 @@ module Custodian
@error = nil
#
+ # Get the timeout period.
+ #
+ settings = Custodian::Settings.instance()
+ period = settings.timeout()
+
+ #
# Do the lookup
#
- results = resolve_via( @host, @resolve_type, @resolve_name, 30 )
+ results = resolve_via( @host, @resolve_type, @resolve_name, period )
return false if ( results.nil? )
#