Jira (PUP-1457) fail should be usable in a selector

2015-04-14 Thread Nick Howes (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Nick Howes updated an issue 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 Puppet /  PUP-1457 
 
 
 
  fail should be usable in a selector  
 
 
 
 
 
 
 
 
 

Change By:
 
 Nick Howes 
 
 
 
 
 
 
 
 
 
 Itwouldbeniceifthisworkedbetter: pre {code} notify{test:message=$environment?{production=http://blah/blah/prod,development=http://blah/blah/dev,default=fail(environment'${environment}'isnotyetsupported),}} /pre {code} Desiredresultwhenthedefaultbranchoftheselectoristaken:Failuretocompilethecatalog,withtheerrormessageenvironment'foo'isnotsupported.Actualresultwhenthedefaultbranchoftheselectoristaken:Failuretocompilethecatalog,withtheerrormessageFunction'fail'doesnotreturnavalue.Usecase:Downloadinganenvironment-dependentURLontheclient. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.3.15#6346-sha1:dbc023d) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-1457) fail should be usable in a selector

2015-04-14 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-1457 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
  Re: fail should be usable in a selector  
 
 
 
 
 
 
 
 
 
 
This is fixed in the future parser where both of these work: 
 
 
 
 
 
 
$bar = case $foo { 
 
 
 
 
  one: { x } 
 
 
 
 
  two: { y } 
 
 
 
 
  default: fail(Unknown foo: ${foo}) 
 
 
 
 
}
 
 
 
 
 
 
 
or: 
 
 
 
 
 
 
$bar = $foo ? { 
 
 
 
 
  _one_ = x, 
 
 
 
 
  two = y, 
 
 
 
 
  default = fail(Unknown foo: ${foo}) 
 
 
 
 
}
 

Jira (PUP-1457) fail should be usable in a selector

2015-03-23 Thread Victor Engmark (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Victor Engmark commented on  PUP-1457 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
  Re: fail should be usable in a selector  
 
 
 
 
 
 
 
 
 
 
+1 Using the `case` statement means duplicating at least the variable name for every case. Which one is nicer: 
case $foo { one:  { $bar = x } 
 two:  { $bar = y } 
 default: fail(Unknown foo: $ {foo}) }  or:  $bar = $foo ? { one: x, two: y, default: fail(Unknown foo: ${foo} 
) } 
The former has five tokens per case ('one:', '{', '$bar', '=', 'x'), while the latter has two ('one:', 'x,') or three depending on whether you count the comma separately. This scales linearly with the number of cases. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 


 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-1457) fail should be usable in a selector

2014-01-16 Thread redmine.exporter (JIRA)
Title: Message Title










 

 redmine.exporter created an issue


















 Puppet /  PUP-1457



  fail should be usable in a selector 










Issue Type:

  New Feature




Assignee:


 Unassigned




Created:


 16/Jan/14 1:07 PM




Labels:


 redmine




Priority:

  Normal




Reporter:

 redmine.exporter










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.












   

 Add Comment


   

Jira (PUP-1457) fail should be usable in a selector

2014-01-16 Thread Gavin Williams (JIRA)
Title: Message Title










 

 Gavin Williams commented on an issue


















  Re: fail should be usable in a selector 










Migrated this in case it's become easier to address with the future parser??? 












   

 Add Comment

























 Puppet /  PUP-1457



  fail should be usable in a selector 







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















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.


Jira (PUP-1457) fail should be usable in a selector

2014-01-16 Thread garrett honeycutt (JIRA)
Title: Message Title










 

 garrett honeycutt commented on an issue


















  Re: fail should be usable in a selector 










-1
Since `case` already exists and handles this, I do not see a real need to change how the `?` operator works.












   

 Add Comment

























 Puppet /  PUP-1457



  fail should be usable in a selector 







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















 This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede)




 














-- 
You received this message because you are subscribed to the Google Groups Puppet Bugs group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.