Sha256: 9ef8fe528d7e7aa14095bb15223d3c810a2ac163e1fb8246ab72418ea3cc6d75

Contents?: true

Size: 993 Bytes

Versions: 20

Compression:

Stored size: 993 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

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.3.0-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.3.0-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.3.0-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.3.1 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.3.1-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.3.1-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.3.1-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.2.0 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.2.0-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.2.0-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.2.0-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.1.0 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.1.0-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.1.0-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.1.0-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.0.1 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.0.1-x86-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.0.1-x64-mingw32 lib/puppet/parser/compiler/catalog_validator.rb
puppet-8.0.1-universal-darwin lib/puppet/parser/compiler/catalog_validator.rb