Class: Puppet::SSL::StateMachine::Wait Private
- Defined in:
- lib/puppet/ssl/state_machine.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
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
private
A new instance of Wait.
- #next_state ⇒ Object private
Methods inherited from SSLState
Constructor Details
#initialize(machine) ⇒ Wait
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Wait.
350 351 352 |
# File 'lib/puppet/ssl/state_machine.rb', line 350 def initialize(machine) super(machine, nil) end |
Instance Method Details
#next_state ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
# File 'lib/puppet/ssl/state_machine.rb', line 354 def next_state time = @machine.waitforcert if time < 1 log_error(_("Exiting now because the waitforcert setting is set to 0.")) exit(1) elsif Time.now.to_i > @machine.wait_deadline log_error(_("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}) # close http/tls and session state before sleeping Puppet.runtime[:http].close @machine.session = Puppet.runtime[:http].create_session @machine.unlock Kernel.sleep(time) NeedLock.new(@machine) end end |