summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/client
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-09-23 22:31:55 -0500
committerLuke Kanies <luke@madstop.com>2008-09-23 22:31:55 -0500
commit4aeabbbb2163684ff7064198c653cd60d46e5717 (patch)
tree7c3593bde6b7f28f3e20444a576eb37338cced14 /lib/puppet/network/client
parent5b9dd01326a61b9ae89ae978e29a8170f76deb5e (diff)
parent8d5ded09b9c9c944695c015e6e95b10ccebd6fb5 (diff)
downloadpuppet-4aeabbbb2163684ff7064198c653cd60d46e5717.tar.gz
puppet-4aeabbbb2163684ff7064198c653cd60d46e5717.tar.xz
puppet-4aeabbbb2163684ff7064198c653cd60d46e5717.zip
Merge branch '0.24.x'
Conflicts: lib/puppet/metatype/container.rb lib/puppet/metatype/instances.rb lib/puppet/metatype/metaparams.rb lib/puppet/metatype/relationships.rb lib/puppet/metatype/schedules.rb
Diffstat (limited to 'lib/puppet/network/client')
-rw-r--r--lib/puppet/network/client/master.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/puppet/network/client/master.rb b/lib/puppet/network/client/master.rb
index 5ca898dab..fe257db2b 100644
--- a/lib/puppet/network/client/master.rb
+++ b/lib/puppet/network/client/master.rb
@@ -198,6 +198,7 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
self.class.instance = self
@running = false
+ @splayed = false
end
# Mark that we should restart. The Puppet module checks whether we're running,
@@ -477,20 +478,19 @@ class Puppet::Network::Client::Master < Puppet::Network::Client
@lockfile
end
+ def splayed?
+ @splayed
+ end
+
# Sleep when splay is enabled; else just return.
def splay
return unless Puppet[:splay]
+ return if splayed?
- limit = Integer(Puppet[:splaylimit])
-
- # Pick a splay time and then cache it.
- unless time = Puppet::Util::Storage.cache(:configuration)[:splay_time]
- time = rand(limit)
- Puppet::Util::Storage.cache(:configuration)[:splay_time] = time
- end
-
+ time = rand(Integer(Puppet[:splaylimit]))
Puppet.info "Sleeping for %s seconds (splay is enabled)" % time
sleep(time)
+ @splayed = true
end
private