On Puppet 4.4.1

I ran the following: 

class testingclass(
  $cmd_path = 'PluginDir',
){
  $message_ntfy = "cmd_path is set to: ${cmd_path} for ${name}"
  notify { $message_ntfy: }
}


define testingdefine(
  $cmd_path = 'PluginDir',
){
  $message_ntfy = "cmd_path is set to: ${cmd_path} for ${name}"
  notify { $message_ntfy: }
}


node default {


  class {'testingclass':
    cmd_path => undef,
  }


 testingdefine { 'testingdefinedefaults': }
 testingdefine { 'testingdefineundef':
  cmd_path => undef,
 }
}

I expect cmd_path to be set to undef for the class and testingdefineundef. 
Instead it looks like all three end up with the same value for cmd_path: 

erik.anderson@puppetmaster1:~$ sudo puppet apply test.pp
Warning: Config file /etc/puppetlabs/code/hiera.yaml not found, using Hiera 
defaults
Notice: Compiled catalog for sa-sand-puppetmaster1.sa.moneydesktop.com in 
environment production in 0.15 seconds
Notice: cmd_path is set to: PluginDir for testingclass
Notice: /Stage[main]/Testingclass/Notify[cmd_path is set to: PluginDir for 
testingclass]/message: defined 'message' as 'cmd_path is set to: PluginDir 
for testingclass'
Notice: cmd_path is set to: PluginDir for testingdefinedefaults
Notice: /Stage[main]/Main/Node[default]/Testingdefine[testingdefinedefaults
]/Notify[cmd_path is set to: PluginDir for testingdefinedefaults]/message: 
defined 'message' as 'cmd_path is set to: PluginDir for 
testingdefinedefaults'
Notice: cmd_path is set to: PluginDir for testingdefineundef
Notice: /Stage[main]/Main/Node[default]/Testingdefine[testingdefineundef]/
Notify[cmd_path is set to: PluginDir for testingdefineundef]/message: 
defined 'message' as 'cmd_path is set to: PluginDir for testingdefineundef'
Notice: Applied catalog in 0.35 seconds

Any ideas on why it is behaving this way and is it intentional?

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/26d1f9c0-61b6-47d3-a7fc-350fee0f2035%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to