Class: Puppet::SSL::StateMachine::SSLState Private

Inherits:
Object
  • Object
show all
Defined in:
lib/puppet/ssl/state_machine.rb

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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(machine, ssl_context) ⇒ SSLState

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 SSLState.



20
21
22
23
24
25
# File 'lib/puppet/ssl/state_machine.rb', line 20

def initialize(machine, ssl_context)
  @machine = machine
  @ssl_context = ssl_context
  @cert_provider = machine.cert_provider
  @ssl_provider = machine.ssl_provider
end

Instance Attribute Details

#ssl_contextObject (readonly)

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.



18
19
20
# File 'lib/puppet/ssl/state_machine.rb', line 18

def ssl_context
  @ssl_context
end

Instance Method Details

#log_error(message) ⇒ 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.



33
34
35
36
37
38
39
40
# File 'lib/puppet/ssl/state_machine.rb', line 33

def log_error(message)
  # When running daemonized we set stdout to /dev/null, so write to the log instead
  if Puppet[:daemonize]
    Puppet.err(message)
  else
    $stdout.puts(message)
  end
end

#to_error(message, cause) ⇒ 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.



27
28
29
30
31
# File 'lib/puppet/ssl/state_machine.rb', line 27

def to_error(message, cause)
  detail = Puppet::Error.new(message)
  detail.set_backtrace(cause.backtrace)
  Error.new(@machine, message, detail)
end