Sha256: b0d05d69c2298fcf03e2b11e09a4908e79abff8223cd6bbae9647a1d8b3a6bb1

Contents?: true

Size: 1.1 KB

Versions: 28

Compression:

Stored size: 1.1 KB

Contents

module Puppet::Pops
module Validation
# Configures validation suitable for 4.0
#
class ValidatorFactory_4_0 < Factory
  Issues = Issues

  # Produces the checker to use
  def checker diagnostic_producer
    Checker4_0.new(diagnostic_producer)
  end

  # Produces the label provider to use
  def label_provider
    Model::ModelLabelProvider.new()
  end

  # Produces the severity producer to use
  def severity_producer
    p = super

    # Configure each issue that should **not** be an error
    #
    # Validate as per the current runtime configuration
    p[Issues::RT_NO_STORECONFIGS_EXPORT]    = Puppet[:storeconfigs] ? :ignore : :warning
    p[Issues::RT_NO_STORECONFIGS]           = Puppet[:storeconfigs] ? :ignore : :warning

    p[Issues::FUTURE_RESERVED_WORD]          = :deprecation

    p[Issues::DUPLICATE_KEY]                 = Puppet[:strict] == :off ? :ignore : Puppet[:strict]
    p[Issues::DUPLICATE_DEFAULT]             = Puppet[:strict] == :off ? :ignore : Puppet[:strict]
    p[Issues::NAME_WITH_HYPHEN]              = :error
    p[Issues::EMPTY_RESOURCE_SPECIALIZATION] = :ignore
    p
  end
end
end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
puppet-4.10.1 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.1-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.1-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.1-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.0 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.0-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.0-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.10.0-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.4 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.4-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.4-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.4-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.3 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.3-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.3-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.3-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.2 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.2-x86-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.2-x64-mingw32 lib/puppet/pops/validation/validator_factory_4_0.rb
puppet-4.9.2-universal-darwin lib/puppet/pops/validation/validator_factory_4_0.rb