Is there a way to see if variables are defined?
if(defined($var)) {
} else {
fail("var is not defined")
}
I am getting the error:
err: Could not retrieve catalog: interning empty string at
/etc/puppet/modules-dev/puppet/manifests/init.pp:14 on node
viepcldx-e10.eu.boehringer.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Le jeudi 02 juillet 2009 à 13:35 +0200, Dan Bode a écrit :> Is there a way to see if variables are defined?I use this syntax : if $var { # blah } else { # bluh } requires a not-too-old puppet Nico.
Hi>> Is there a way to see if variables are defined? > > I use this syntax : > > if $var { > # blah > } > else > { > # bluh > } > > requires a not-too-old puppetwhich will #bluh if $var is set to false as well, however you can do: if ($var != '''') { # blah } else { # bluh } cheers pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---