summaryrefslogtreecommitdiff
path: root/lib/puppet/functions/validate_legacy.rb
diff options
context:
space:
mode:
authorHelen Campbell <helen@puppetlabs.com>2016-09-06 15:00:07 +0100
committerHelen Campbell <helen@puppetlabs.com>2016-09-06 15:15:29 +0100
commitb63862ff43194194f7428739a32cfe13bad1e7ed (patch)
tree718e8f1e6cf3ed846af73a81bf8b6d3226e59842 /lib/puppet/functions/validate_legacy.rb
parentb2d05e9b3f5da65ad3dc39b95b342e9085e52346 (diff)
Addition of logging with file and line numbers
Diffstat (limited to 'lib/puppet/functions/validate_legacy.rb')
-rw-r--r--lib/puppet/functions/validate_legacy.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/puppet/functions/validate_legacy.rb b/lib/puppet/functions/validate_legacy.rb
index 9d7d012..b1066e2 100644
--- a/lib/puppet/functions/validate_legacy.rb
+++ b/lib/puppet/functions/validate_legacy.rb
@@ -28,8 +28,10 @@ Puppet::Functions.create_function(:validate_legacy, Puppet::Functions::InternalF
Puppet.warn("Accepting previously invalid value for target_type '#{target_type}'")
end
else
+ caller_infos = caller.first.split(":")
inferred_type = Puppet::Pops::Types::TypeCalculator.infer_set(value)
- error_msg = Puppet::Pops::Types::TypeMismatchDescriber.new.describe_mismatch(previous_validation, target_type, inferred_type)
+ message = Puppet::Pops::Types::TypeMismatchDescriber.new.describe_mismatch(previous_validation, target_type, inferred_type)
+ error_msg = "#{message} : #{caller_infos[0]} : #{caller_infos[1]}"
if previous_validation(previous_validation, value, *prev_args)
Puppet.warn(error_msg)
else