File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change 8
8
end
9
9
10
10
def deprecation ( key , message )
11
+ stacktrace = Puppet ::Pops ::PuppetStack . stacktrace ( )
12
+ output_message = "${message} at ${stacktrace[0][0]}:${stacktrace[0]:[1]}"
11
13
# depending on configuration setting of strict
12
14
case Puppet . settings [ :strict ]
13
15
when :off
14
16
# do nothing
15
17
when :error
16
- fail ( "deprecation. #{ key } . #{ message } " )
18
+ fail ( "deprecation. #{ key } . #{ output_message } " )
17
19
else
18
20
unless ENV [ 'STDLIB_LOG_DEPRECATIONS' ] == 'false'
19
- Puppet . deprecation_warning ( message , key )
21
+ Puppet . deprecation_warning ( output_message , key )
20
22
end
21
23
end
22
24
end
Original file line number Diff line number Diff line change 31
31
end
32
32
33
33
it "should show the error message" do
34
- expect ( @result . stderr ) . to match ( /deprecation. key. message/ )
34
+ expect ( @result . stderr ) . to match ( /deprecation. key. \$ \{ message\} / )
35
35
end
36
36
37
37
describe file ( "#{ test_file } " ) do
53
53
end
54
54
55
55
it "should show the error message" do
56
- expect ( @result . stderr ) . to match ( /Warning: message/ )
56
+ expect ( @result . stderr ) . to match ( /Warning: \$ \{ message\} at \$ \{ stacktrace \[ 0 \] \[ 0 \] \} : \$ \{ stacktrace \[ 0 \] : \[ 1 \] \} / )
57
57
end
58
58
59
59
describe file ( "#{ test_file } " ) do
You can’t perform that action at this time.
0 commit comments