Class: Puppet::Pops::Evaluator::Runtime3Support::SeverityProducer Private

Inherits:
Validation::SeverityProducer show all
Defined in:
lib/puppet/pops/evaluator/runtime3_support.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Configure the severity of failures

Constant Summary

Constants inherited from Validation::SeverityProducer

Validation::SeverityProducer::SEVERITIES

Instance Method Summary collapse

Methods inherited from Validation::SeverityProducer

#[], #[]=, #assert_issue, #severity, #should_report?

Constructor Details

#initializeSeverityProducer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SeverityProducer.



477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/puppet/pops/evaluator/runtime3_support.rb', line 477

def initialize
  super
  p = self
  # Issues triggering warning only if --debug is on
  if Puppet[:debug]
    p[Issues::EMPTY_RESOURCE_SPECIALIZATION] = :warning
  else
    p[Issues::EMPTY_RESOURCE_SPECIALIZATION] = :ignore
  end

  # if strict variables are on, an error is raised
  # if strict variables are off, the Puppet[strict] defines what is done
  #
  if Puppet[:strict_variables]
    p[Issues::UNKNOWN_VARIABLE] = :error
  elsif Puppet[:strict] == :off
    p[Issues::UNKNOWN_VARIABLE] = :ignore
  else
    p[Issues::UNKNOWN_VARIABLE] = Puppet[:strict]
  end

  # Store config issues, ignore or warning
  p[Issues::RT_NO_STORECONFIGS_EXPORT]    = Puppet[:storeconfigs] ? :ignore : :warning
  p[Issues::RT_NO_STORECONFIGS]           = Puppet[:storeconfigs] ? :ignore : :warning
  p[Issues::CLASS_NOT_VIRTUALIZABLE]      = :error
  p[Issues::NUMERIC_COERCION]             = Puppet[:strict] == :off ? :ignore : Puppet[:strict]
  p[Issues::SERIALIZATION_DEFAULT_CONVERTED_TO_STRING] = Puppet[:strict] == :off ? :warning : Puppet[:strict]
  p[Issues::SERIALIZATION_UNKNOWN_CONVERTED_TO_STRING] = Puppet[:strict] == :off ? :warning : Puppet[:strict]
  p[Issues::SERIALIZATION_UNKNOWN_KEY_CONVERTED_TO_STRING] = Puppet[:strict] == :off ? :warning : Puppet[:strict]
end