Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Agent
-
1
-
Agent 2017-06-14
-
Needs Assessment
-
Bug Fix
-
Some deprecation warnings were issued even when using {{\--disable_warnings deprecations}}.
-
Manual
-
We should verify this works correctly now
Description
There are a few different issues with how warn_once is implemented that prevent deprecation warnings from being silenced.
- There are typos, e.g. deprecatation
- We use both symbols and strings:
Puppet.warn_once('deprecation', 'AST::ResourceParam', _('Use of Puppet::Parser::AST::ResourceParam is deprecated and not fully functional'))
Puppet.warn_once(:deprecation, "metadata.json#data_provider-#{module_name}",
- The warn_once logic doesn't account for string vs symbol, which probably wasn't a problem before we removed the symbol string monkey_patch:
return if Puppet[:disable_warnings].include?(kind)
- The disable_warnings setting only accepts plural deprecations, but all of the warn_once call sites use singular deprecation, so the include? check never matches
- There is another warnonce method defined in Puppet::Util::Warnings.
But the main issue is that you can't turn deprecations off:
notify { '1': |
message => strftime("%s") |
}
|
notify { '2': |
message => strftime("%s") |
}
|
$ bundle exec puppet apply warnings.pp --disable_warnings deprecations
|
/Users/josh/work/puppet/.bundle/ruby/2.4.0/gems/CFPropertyList-2.2.8/lib/cfpropertylist/rbCFTypes.rb:24: warning: constant ::Fixnum is deprecated
|
Warning: The argument signature (String format, [String timezone]) is deprecated for #strfime. See #strftime documentation and Timespan type for more info
|
(file & line not available)
|
Notice: Compiled catalog for chara.corp.puppetlabs.net in environment production in 0.02 seconds
|
Notice: 1496267306
|
Notice: /Stage[main]/Main/Notify[1]/message: defined 'message' as '1496267306'
|
Notice: 1496267306
|
Notice: /Stage[main]/Main/Notify[2]/message: defined 'message' as '1496267306'
|
Notice: 1496267306
|