Re: Suppress deprecation warnings because of Referencing Variables

1,525 views
Skip to first unread message

jcbollinger

unread,
May 24, 2013, 10:10:53 AM5/24/13
to puppet...@googlegroups.com


On Thursday, May 23, 2013 11:09:51 PM UTC-5, Nam Nguyen wrote:
Hey guys, 
after upgrading Puppet to version 3.2.1 I got lots of warning like this: 

Warning: Variable access via 'logroot' is deprecated. Use '@logroot' instead. template[/etc/puppet/modules/apache/templates/vhost-default.conf.erb]:24

I used puppet many modules which don't use @ or $ in front of reference variables, so I will be a pain to fix them all. 
Is there any way I can suppress (hide | disable) these warnings?


I don't know about suppressing the warnings, but unless you intend to stop at Puppet 3.2, you really ought to fix them.  Deprecation is a prelude to feature removal, so you can expect that your templates will no longer work with some future version of Puppet.  You can put off changes until then if you want, but I'd recommend that you do the work now.  That will help you avoid making more future work for yourself, by causing new uses of the deprecated style to stand out.


John

Nam Nguyen

unread,
May 24, 2013, 11:39:28 AM5/24/13
to puppet...@googlegroups.com
John, thanks so much for your notice, yes I thought about this too, and, now I think I should spend sometime fixing them rather than suppressing. At first I was frustrated because of so many warning, but now I got it, I dont think I should stop at version < 3.2. 

NN

Martijn

unread,
May 28, 2013, 4:25:56 AM5/28/13
to puppet...@googlegroups.com
Op vrijdag 24 mei 2013 16:13:49 UTC+2 schreef Christopher Rutter het volgende:
I feel like this new "warning" might have been a bit premature, then again, I suppose this will force people to fix the problem. 
-Chris


That's exactly what a deprecation warning is for. It doesn't break anything yet, but gets people to take notice. :-)

Thankfully, deprecation warnings only show when the puppet master is restarted.

Regards, Martijn

Eric Sorenson

unread,
May 28, 2013, 3:22:10 PM5/28/13
to puppet...@googlegroups.com
Chris, thanks very much for the pull requests to fix the modules.

I'll work up a fix for the docs; it looks like in particular the second bullet at http://docs.puppetlabs.com/guides/templating.html#referencing-variables needs to reflect the deprecation and, as you note, the second half still uses the bareword.

As an aside it's totally awesome that people are picking up on all the new stuff in the 3.2 release. Keep 'em coming! 

eric0

On Friday, May 24, 2013 7:13:49 AM UTC-7, Christopher Rutter wrote:
I am in the same boat here. For example there are a few puppetlabs modules that currently don't have a stable release that fixes this:
And this isn't even all of them, only the ones that I use...
Sure this issue is addressed in the master branch of these modules (or pending pull requests, that I just submitted today) but I don't feel comfortable running 'master' in production.

Heck, even the documentation ("iteration" section and below)  breaks down halfway down the page and stops using the '@'.
I feel like this new "warning" might have been a bit premature, then again, I suppose this will force people to fix the problem. 
-Chris


On Friday, May 24, 2013 12:09:51 AM UTC-4, Nam Nguyen wrote:
Hey guys, 
after upgrading Puppet to version 3.2.1 I got lots of warning like this: 

Warning: Variable access via 'logroot' is deprecated. Use '@logroot' instead. template[/etc/puppet/modules/apache/templates/vhost-default.conf.erb]:24

I used puppet many modules which don't use @ or $ in front of reference variables, so I will be a pain to fix them all. 
Is there any way I can suppress (hide | disable) these warnings?

NN.

Reply all
Reply to author
Forward
0 new messages