Sha256: 6a0d8767df1e7bf338f0320954ba4f3d4c60d34982067d888bf4239fe49ca3cb

Contents?: true

Size: 914 Bytes

Versions: 4

Compression:

Stored size: 914 Bytes

Contents

require 'puppet/loaders'
require 'puppet/pops'

# A Catalog "compiler" that is like the regular compiler but with an API
# that is harmonized with the ScriptCompiler
#
# The Script compiler is "one shot" - it does not support rechecking if underlying source has changed or
# deal with possible errors in a cached environment.
#
class Puppet::Parser::CatalogCompiler < Puppet::Parser::Compiler

  # Evaluates the configured setup for a script + code in an environment with modules
  #
  def compile
    Puppet[:strict_variables] = true
    Puppet[:strict] = :error

    Puppet.override(rich_data: true) do
      super
    end

  rescue Puppet::ParseErrorWithIssue => detail
    detail.node = node.name
    Puppet.log_exception(detail)
    raise
  rescue => detail
    message = "#{detail} on node #{node.name}"
    Puppet.log_exception(detail, message)
    raise Puppet::Error, message, detail.backtrace
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
puppet-6.0.0 lib/puppet/parser/catalog_compiler.rb
puppet-6.0.0-x86-mingw32 lib/puppet/parser/catalog_compiler.rb
puppet-6.0.0-x64-mingw32 lib/puppet/parser/catalog_compiler.rb
puppet-6.0.0-universal-darwin lib/puppet/parser/catalog_compiler.rb