Sha256: 46a0bc64fbef21d0afb946eb88a5fa3255c3c502379b0e3550c2b2ffc7fa6d91
Contents?: true
Size: 877 Bytes
Versions: 72
Compression:
Stored size: 877 Bytes
Contents
require 'puppet/indirector/status' require 'puppet/indirector/rest' class Puppet::Indirector::Status::Rest < Puppet::Indirector::REST desc "Get puppet master's status via REST. Useful because it tests the health of both the web server and the indirector." def find(request) return super unless use_http_client? session = Puppet.lookup(:http_session) api = session.route_to(:puppet) _, status = api.get_status(request.key) status rescue Puppet::HTTP::ResponseError => e if e.response.code == 404 return nil unless request.options[:fail_on_404] _, body = parse_response(e.response.nethttp) msg = _("Find %{uri} resulted in 404 with the message: %{body}") % { uri: elide(e.response.url.path, 100), body: body } raise Puppet::Error, msg else raise convert_to_http_error(e.response.nethttp) end end end
Version data entries
72 entries across 72 versions & 1 rubygems