diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-14 16:04:12 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-14 16:04:12 +0000 |
commit | 85fef63889ca60329493583988affe67b59d143d (patch) | |
tree | aaddda47911a505fd3ae5d997107a8a39fe848ec | |
parent | 27cabf25fc08ee77df08ec65a440f9d164b9215d (diff) | |
download | puppet-85fef63889ca60329493583988affe67b59d143d.tar.gz puppet-85fef63889ca60329493583988affe67b59d143d.tar.xz puppet-85fef63889ca60329493583988affe67b59d143d.zip |
fixing some problems with the config timeout -- I am not sure it ever actually worked
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2512 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r-- | lib/puppet/network/client/master.rb | 10 | ||||
-rwxr-xr-x | test/network/client/master.rb | 18 |
2 files changed, 24 insertions, 4 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb index e358a1d55..6db2e98c7 100644 --- a/lib/puppet/network/client/master.rb +++ b/lib/puppet/network/client/master.rb @@ -483,11 +483,11 @@ class Puppet::Network::Client::Master < Puppet::Network::Client end def self.timeout - @timeout = Puppet[:configtimeout] - case @timeout + timeout = Puppet[:configtimeout] + case timeout when String: - if @timeout =~ /^\d+$/ - @timeout = Integer(@timeout) + if timeout =~ /^\d+$/ + timeout = Integer(timeout) else raise ArgumentError, "Configuration timeout must be an integer" end @@ -495,6 +495,8 @@ class Puppet::Network::Client::Master < Puppet::Network::Client else raise ArgumentError, "Configuration timeout must be an integer" end + + return timeout end # Send off the transaction report. diff --git a/test/network/client/master.rb b/test/network/client/master.rb index c53e292c8..ffdb8a0ce 100755 --- a/test/network/client/master.rb +++ b/test/network/client/master.rb @@ -622,6 +622,24 @@ end assert(! master.send(:lockfile).locked?, "Master is still locked after failure") end + + # Make sure we get a value for timeout + def test_config_timeout + master = Puppet::Network::Client.client(:master) + time = Integer(Puppet[:configtimeout]) + assert_equal(time, master.timeout, "Did not get default value for timeout") + assert_equal(time, master.timeout, "Did not get default value for timeout on second run") + + # Reset it + Puppet[:configtimeout] = "50" + assert_equal(50, master.timeout, "Did not get changed default value for timeout") + assert_equal(50, master.timeout, "Did not get changed default value for timeout on second run") + + # Now try an integer + Puppet[:configtimeout] = 100 + assert_equal(100, master.timeout, "Did not get changed integer default value for timeout") + assert_equal(100, master.timeout, "Did not get changed integer default value for timeout on second run") + end end # $Id$ |