Is there a way to shut up the undefined variable warnings in PE2016.1 ?

Here's a trivial example:

# puppet apply -t --noop -e 'notice("this should print just a 'x' => 
x${foo}")'
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Info: Loading facts
Warning: Undefined variable 'foo'; 
   (file & line not available)
Notice: Scope(Class[main]): this should print just a x => x
Notice: Compiled catalog for myhostname.com in environment production in 
0.04 seconds

I see there is a --strict-variables where I can make compilation fail.
It seems that throwing the warning is the current default
I'm looking for a "yes I have a good reason so please just quit whining 
about what I am doing" switch :-)

Alternately, is there a way to check for the fact being not defined ?
I can not find any syntax that works in the 2016.1 parser. 

something along the lines of notionally the following:
if $whatever is defined print out 'whatever = $whatever'
if $whatever is not defined print out 'whatever is not defined' or null or 
undef or whatever it evaluates to currently.

I'm probably in interpreted language overload among perl/python/bash and 
the Puppet DSL is just not grokking.....

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/dcfb928f-6e74-4974-9505-88d446c682f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to