Class: Puppet::HTTP::Resolver::Settings

Inherits:
Puppet::HTTP::Resolver show all
Defined in:
lib/puppet/http/resolver/settings.rb

Overview

Resolve a service using settings. This is the default resolver if none of the other resolvers find a functional connection.

Instance Method Summary collapse

Methods inherited from Puppet::HTTP::Resolver

#check_connection?, #initialize

Constructor Details

This class inherits a constructor from Puppet::HTTP::Resolver

Instance Method Details

#resolve(session, name, ssl_context: nil, canceled_handler: nil) ⇒ Puppet::HTTP::Service

Resolve a service using the default server and port settings for this service.

Parameters:

  • session (Puppet::HTTP::Session)
  • name (Symbol)

    the name of the service to be resolved

  • ssl_context (Puppet::SSL::SSLContext) (defaults to: nil)
  • canceled_handler (Proc) (defaults to: nil)

    optional callback allowing a resolver to cancel resolution.

Returns:



20
21
22
23
# File 'lib/puppet/http/resolver/settings.rb', line 20

def resolve(session, name, ssl_context: nil, canceled_handler: nil)
  service = Puppet::HTTP::Service.create_service(@client, session, name)
  check_connection?(session, service, ssl_context: ssl_context) ? service : nil
end