Class: Puppet::SSL::StateMachine::Wait
- Defined in:
- lib/puppet/ssl/state_machine.rb
Overview
We cannot make progress, so wait if allowed to do so, or exit.
Instance Attribute Summary
Attributes inherited from SSLState
Instance Method Summary collapse
-
#initialize(machine) ⇒ Wait
constructor
A new instance of Wait.
- #next_state ⇒ Object
Methods inherited from SSLState
Constructor Details
#initialize(machine) ⇒ Wait
261 262 263 |
# File 'lib/puppet/ssl/state_machine.rb', line 261 def initialize(machine) super(machine, nil) end |
Instance Method Details
#next_state ⇒ Object
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/puppet/ssl/state_machine.rb', line 265 def next_state time = @machine.waitforcert if time < 1 puts _("Exiting now because the waitforcert setting is set to 0.") exit(1) elsif Time.now.to_i > @machine.wait_deadline puts _("Couldn't fetch certificate from CA server; you might still need to sign this agent's certificate (%{name}). Exiting now because the maxwaitforcert timeout has been exceeded.") % {name: Puppet[:certname] } exit(1) else Puppet.info(_("Will try again in %{time} seconds.") % {time: time}) Kernel.sleep(time) # our ssl directory may have been cleaned while we were # sleeping, start over from the top NeedCACerts.new(@machine) end end |