Issue #4598 has been updated by Luke Kanies.

Category changed from metaparameters to parser
Status changed from Needs design decision to Accepted
Assignee deleted (Luke Kanies)

I'm fine with this in theory, but in practice, it's harder than it sounds.

Puppet differentiates between functions that return a value and those that 
don't, and this would basically require that we change that, so it's 
potentially a large change.
----------------------------------------
Feature #4598: fail should be usable in a selector
http://projects.puppetlabs.com/issues/4598

Author: Alan Barrett
Status: Accepted
Priority: Normal
Assignee: 
Category: parser
Target version: 
Affected version: 
Keywords: 
Branch: 


It would be nice if this worked better:
<pre>
notify { "test":
    message => $environment ? {
        production => "http://blah/blah/prod";,
        development => "http://blah/blah/dev";,
        default => fail("environment '${environment}' is not yet supported"),
    }
}
</pre>

Desired result when the default branch of the selector is taken:  Failure to 
compile the catalog, with the error message "environment 'foo' is not 
supported".

Actual result when the default branch of the selector is taken:  Failure to 
compile the catalog, with the error message "Function 'fail' does not return a 
value".

Use case:  Downloading an environment-dependent URL on the client.


-- 
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