diff options
author | Eric Putnam <putnam.eric@gmail.com> | 2016-09-06 08:24:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-06 08:24:07 -0700 |
commit | d350ee49ee318353e9aa596c254ffbc40eba5b8d (patch) | |
tree | d761e27d94bc48c6b55e1bbb2d95805be21cfe5f /lib/puppet/functions/validate_legacy.rb | |
parent | 8da9579f34ea851da9d484fbe87436787a6e19bb (diff) | |
parent | b63862ff43194194f7428739a32cfe13bad1e7ed (diff) |
Merge pull request #651 from HelenCampbell/deprecationUpdate
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.rb | 4 |
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 |