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