Method: Puppet::Parser::Scope#handle_not_found

Defined in:
lib/puppet/parser/scope.rb

#handle_not_found(class_name, variable_name, position, reason = nil) ⇒ Object



641
642
643
644
645
646
647
648
649
650
651
652
653
# File 'lib/puppet/parser/scope.rb', line 641

def handle_not_found(class_name, variable_name, position, reason = nil)
  unless Puppet[:strict_variables]
    # Do not issue warning if strict variables are on, as an error will be raised by variable_not_found
    location = if position[:lineproc]
                 Puppet::Util::Errors.error_location_with_space(nil, position[:lineproc].call)
               else
                 Puppet::Util::Errors.error_location_with_space(position[:file], position[:line])
               end
    variable_not_found("#{class_name}::#{variable_name}", "#{reason}#{location}")
    return nil
  end
  variable_not_found("#{class_name}::#{variable_name}", reason)
end