Issue #15230 has been updated by eric sorenson.

Status changed from Unreviewed to Rejected

Closing, as Nan said this may come up as a result of a larger rewrite.
----------------------------------------
Bug #15230: puppet variables function differently as define arguments
https://projects.puppetlabs.com/issues/15230#change-68911

Author: James Shubin
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


Puppet code and variables have no "order". This allows you to do clever things 
in puppet, which is why it is elegant.
This doesn't seem to apply fully to define variables. All of the following 
examples *should* work, but only #3 does. Example code below:


#!/usr/bin/puppet

# this doesn't work
define smart_define1(
        $foo = ['bar', "name=${bar}"],
        $bar = 'something',
) {
        notice $foo
}

define smart_define2(
        $foo = ['bar', "name=${cooltest}"],
) {
        notice $foo

        #$cooltest = "doesn't work: ${name}"    # this doesn't work
        $cooltest = 'this does not work!'       # this doesn't work
}

# works
define smart_define3(
        $foo = ['bar', "name=${name}"],
) {
        notice $foo

}

smart_define3 { 'thisisaname':

}


HTH,
James



-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to