File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-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
+ file = stacktrace [ 0 ]
13
+ line = stacktrace [ 1 ]
14
+ output_message = "#{ message } at #{ file } :#{ line } "
11
15
# depending on configuration setting of strict
12
16
case Puppet . settings [ :strict ]
13
17
when :off
14
18
# do nothing
15
19
when :error
16
- fail ( "deprecation. #{ key } . #{ message } " )
20
+ fail ( "deprecation. #{ key } . #{ output_message } " )
17
21
else
18
22
unless ENV [ 'STDLIB_LOG_DEPRECATIONS' ] == 'false'
19
- Puppet . deprecation_warning ( message , key )
23
+ Puppet . deprecation_warning ( output_message , key )
20
24
end
21
25
end
22
26
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 at / )
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 / )
57
57
end
58
58
59
59
describe file ( "#{ test_file } " ) do
You can’t perform that action at this time.
0 commit comments