Sha256: 65e04181a9bac0cf25b28b7774de85b2e906dc41fc0b963a134559417b782ecd

Contents?: true

Size: 994 Bytes

Versions: 32

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

# Abstract class for a catalog validator that can be registered with the compiler to run at
# a certain stage.
class Puppet::Parser::Compiler
  class CatalogValidator
    PRE_FINISH = :pre_finish
    FINAL = :final

    # Returns true if the validator should run at the given stage. The default
    # implementation will only run at stage `FINAL`
    #
    # @param stage [Symbol] One of the stage constants defined in this class
    # @return [Boolean] true if the validator should run at the given stage
    #
    def self.validation_stage?(stage)
      FINAL.equal?(stage)
    end

    attr_reader :catalog

    # @param catalog [Puppet::Resource::Catalog] The catalog to validate
    def initialize(catalog)
      @catalog = catalog
    end

    # Validate some aspect of the catalog and raise a `CatalogValidationError` on failure
    def validate
    end
  end

  class CatalogValidationError < Puppet::Error
    include Puppet::ExternalFileError
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.10.0-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.10.0-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.10.0-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.9.0 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.9.0-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.9.0-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.9.0-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.8.1 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.8.1-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.8.1-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.8.1-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.7.0 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.7.0-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.7.0-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.7.0-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.6.0 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.6.0-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.6.0-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.6.0-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb