class Puppet::SSL::StateMachine::Wait
We cannot make progress, so wait if allowed to do so, or exit.
Public Class Methods
new(machine)
click to toggle source
Calls superclass method
Puppet::SSL::StateMachine::SSLState::new
# File lib/puppet/ssl/state_machine.rb 266 def initialize(machine) 267 super(machine, nil) 268 end
Public Instance Methods
next_state()
click to toggle source
# File lib/puppet/ssl/state_machine.rb 270 def next_state 271 time = @machine.waitforcert 272 if time < 1 273 puts _("Exiting now because the waitforcert setting is set to 0.") 274 exit(1) 275 elsif Time.now.to_i > @machine.wait_deadline 276 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] } 277 exit(1) 278 else 279 Puppet.info(_("Will try again in %{time} seconds.") % {time: time}) 280 281 # close persistent connections and session state before sleeping 282 Puppet.runtime[:http].close 283 @machine.session = Puppet.runtime[:http].create_session 284 285 @machine.unlock 286 Kernel.sleep(time) 287 NeedLock.new(@machine) 288 end 289 end