Jira (PUP-8067) Selector expression ignored in some scenarios

2018-02-17 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg commented on  PUP-8067  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Selector _expression_ ignored in some scenarios   
 

  
 
 
 
 

 
 Reinhard Vicinus Glad you managed to find the code you needed to change and that it turned out to not be all that bad in the end. Thanks for coming back with that report and also that you agree that it makes sense to have the same precedence as in most other languages.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2018-02-17 Thread Reinhard Vicinus (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhard Vicinus commented on  PUP-8067  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Selector _expression_ ignored in some scenarios   
 

  
 
 
 
 

 
 Sorry, if my comment sounded a little bit harsh, but i got somewhat scared after stumbling over the "silent" breakage. But as far as I can tell this was the only case (the code calculates a nagios threshold value, x is the fact processorcount, the formular works good for processor counts bigger then 4, smaller numbers need some tweeking). The other cases were all in the form:  $config_hash + $config_hash_value ? { undef => {}, default => { config_hash_key => $config_hash_value } } And produced an error and were therefore easily fixed. The reason that there were so many cases was that the code got copied and pasted a lot. All occurrences was in our roles and profiles code which isn't on forge. Regarding the change itself, in my opinion there is no more correct way to precedence ordering. But it makes sense to adhere to standards even if they are only informal. So if other languages have established an informal standard to another precedence ordering, it makes sense to comply.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2018-02-16 Thread Henrik Lindberg (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Henrik Lindberg commented on  PUP-8067  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Selector _expression_ ignored in some scenarios   
 

  
 
 
 
 

 
 No reason for this not being listed as a breaking change except that we missed marking it as such. Sorry for the pain this is causing you. If find/grep does not work you can perhaps use "puppet parser dump" - here is an example of what that looks like for your snippet:  
 
 
 
 
 puppet parser dump -e '$y = 10 + $x ? { default => $x/2, 1 => 4}'  
 
 
 (= $y (? (+ 10 $x) (:default => (/ $x 2)) (1 => 4)))
  
 
 
 
  You would use this with a find of all .pp files (and give parser dump the filename instead of the -e ). Then grep for the  
 
 
 
 
 (? (
  
 
 
 
  which is the marker for "selector _expression_" where value is some kind of _expression_. In 5.4.0 you see  
 
 
 
 
 (? (+ 10 $x) ...
  
 
 
 
  whereas before 5.4.0 you would see  
 
 
 
 
 (? $x ...
  
 
 
 
  Hope that helps in finding the places where you need to adjust.  
 

  
 
 
 
  

Jira (PUP-8067) Selector expression ignored in some scenarios

2018-02-16 Thread Reinhard Vicinus (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Reinhard Vicinus commented on  PUP-8067  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Selector _expression_ ignored in some scenarios   
 

  
 
 
 
 

 
 Is there a reason why this change wasn't listed in the breaking changes section of the puppet 5.4 release notes? Because it breaks our code left and right and sometimes in subtle ways, like this:  
 
 
 
 
 $x = 3  
 
 
 $y = 10 + $x ? { default => $x/2, 1 => 4}
  
 
 
 
  Now this quietly returns 1 were prior puppet versions returned 11. The breakages can be easily fixed by adding parenthesis but finding all occurrences is a bitch...  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.5.1#75006-sha1:7df2574)  
 
 

 
   
 

  
 

  
 

   





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

Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-14 Thread Eric Delaney (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Eric Delaney updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Eric Delaney 
 
 
 

QA Risk Assessment:
 
 Needs Assessment No Action 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-13 Thread Josh Cooper (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Josh Cooper updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Josh Cooper 
 
 
 

Sprint:
 
 Platform Core KANBAN 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-10 Thread Thomas Hallgren (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Thomas Hallgren assigned an issue to Unassigned 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Thomas Hallgren 
 
 
 

Assignee:
 
 Thomas Hallgren 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-10 Thread Thomas Hallgren (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Thomas Hallgren commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
Merged to master at 9487ac3. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-10 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Henrik Lindberg 
 
 
 

Release Notes Summary:
 
 The precedence of the  '?' selector-operator was too highand this made it difficult to use an _expression_ on the left hand side. As an example:{code:puppet}1 + 2 ? { 3 => expected, default => bad }{code}resulted in 'bad'.The precedence has now been changed to be just above {{and / or}}. 
 
 
 

Release Notes:
 
 Bug Fix 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-10 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg assigned an issue to Thomas Hallgren 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Henrik Lindberg 
 
 
 

Assignee:
 
 Henrik Lindberg Thomas Hallgren 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-10 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Henrik Lindberg 
 
 
 

Fix Version/s:
 
 PUP 5.4.0 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-03 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg assigned an issue to Henrik Lindberg 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Henrik Lindberg 
 
 
 

Assignee:
 
 Henrik Lindberg 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-02 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
Nick Walker Deprecation warnings in this case could be complicated to achieve - we can try. Since there is a very small risk we could make the change and then warn that selector now evaluated the entire LHS first if it something other than a primary _expression_. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-02 Thread Eric Sorenson (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Eric Sorenson commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
I just searched through the forge and found 11,480 selectors with zero occurrences of complex expressions as the control _expression_. They are all of the form: 
 
 
 
 
 
 
  302 arusso-apache-0.1.4/manifests/vhost.pp:165:  $ord = $is_default ? { true => '0', default => '1' } 
 
 
 
 
 ... (or as a more complicated example) ... 
 
 
 
 
 5627 gildas-firewall-0.1.1/manifests/rule.pp:66:  $display_option= empty($display)? { true => '', default => "-DisplayName \"${display}\"" }
 
 
 
 
 
 
 
People do nest selectors, but that's unaffected by this proposed change. 
Therefore I'd support changing this even in a non-major release, so we don't have to wait for another year. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
  

Jira (PUP-8067) Selector expression ignored in some scenarios

2017-11-01 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
Eric Sorenson The affected body of code would be only new code as the 3.x parser had many restrictions - don't think you could even get to see this in 3.x with old parser. Still a risk, but smaller body of code. 
Trevor Robinson Totally agree that the behavior is bad; inconsistent with other languages, unintuitive, and it is unintentional.  However, a change silently changes behaviour; existing code could "mysteriously" produce a different result. That kind of change is expensive as users have to review their code and "migrate" rather than "upgrade". It is close to impossible to warn about this and we would have to instrument the runtime logic to aid catalog preview to be able to diff the outcome. 
Given all that, and the fact that this is reported this late in the life of "future parser" (it has been this way since 3.8) is an indication that this cannot be a problem big enough to justify the cost of changing the precedence since there are work arounds: 
 

Use parentheses
 

Use a case or if _expression_
 
 
With that, we will repurpose this ticket to better document the selector _expression_. Ping Jean Bond. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





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

Jira (PUP-8067) Selector expression ignored in some scenarios

2017-10-30 Thread Trevor Robinson (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Trevor Robinson commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
It does solve the problem, though I would personally argue that following other languages' standards in this case would be clearer, and code relying on this behavior is considerably harder to understand because of that and how the current behavior looks inconsistent. E.g.: 
 
 
 
 
 
 
# This resolves the regex and returns a boolean, ignoring the selector 
 
 
 
 
$value =~ /\d/ ? { 
 
 
 
 
  default => 'non-numeric', 
 
 
 
 
  true=> 'numeric', 
 
 
 
 
} 
 
 
 
 
  
 
 
 
 
# This resolves the selector first and compares a string against an Integer, causing a parse error 
 
 
 
 
3 > 3 ? { 
 
 
 
 
  default => 'less than or equal to three', 
 
 
 
 
  true=> 'larger than three', 
   

Jira (PUP-8067) Selector expression ignored in some scenarios

2017-10-30 Thread Eric Sorenson (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Eric Sorenson commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
Is it the case that using parenthesis solves the problem for you, Trevor Robinson? If so I'm strongly in favour of documenting the current precedence more clearly and not changing the underlying behaviour, as there is a body of existing code that could change in subtle ways if we moved the precedence around. 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-10-30 Thread Craig Gomes (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Craig Gomes updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Change By:
 
 Craig Gomes 
 
 
 

Team:
 
 Platform Core 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v7.0.2#70111-sha1:88534db) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-10-18 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
Ping Eric Sorenson - what do you want to do about this? Keep this as it is implemented or change in Puppet 6.0.0 ? (The current implementation ended up with the selector operator having a higher precedence than what is most useful). 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
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 https://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/d/optout.


Jira (PUP-8067) Selector expression ignored in some scenarios

2017-10-18 Thread Henrik Lindberg (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Henrik Lindberg commented on  PUP-8067 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 
 
The precedence of the SelectorExpression (the ?) is indeed quite high among the operators. It is actually specified to have that high precedence so in that sense puppet is doing what it is considered correct. 
I see no real harm in making the operator have lower precedence (it could be placed after or in precedence; which I tested and that does not break any of the language tests). Unfortunately that also means that we do not have test coverage of the behavior in question. 
Changing the precedence is tricky since it is not a backwards compatible change and thus requires a major version. 
There are two workarounds: 
 

Use parenthesis around the "value _expression_" (as already shown)
 

Use a case, if, or unless _expression_ as the conditional _expression_ (depending on how many branch options there are)
 
 
For example: 
 
 
 
 
 
 
$result1 = case $value > 3 { 
 
 
 
 
true :{ 'larger than three' } 
 
 
 
 
default : { 'less than or equal to three' } 
 
 
 
 
  } 
 
 
 
 
  
 
 
 
 
$result2 = if $value > 3 {'larger than three' } else { 'less than or equal to three' } 
 
 
 
 
 

Jira (PUP-8067) Selector expression ignored in some scenarios

2017-10-17 Thread Trevor Robinson (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Trevor Robinson created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Puppet /  PUP-8067 
 
 
 
  Selector _expression_ ignored in some scenarios  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Bug 
 
 
 

Affects Versions:
 

 PUP 5.3.2 
 
 
 

Assignee:
 

 Unassigned 
 
 
 

Components:
 

 Language 
 
 
 

Created:
 

 2017/10/17 4:55 PM 
 
 
 

Environment:
 
 
Ubuntu 16.04, CentOS 7 Installed via puppet5-release repositories 
 
 
 

Labels:
 

 selector parser 
 
 
 

Priority:
 
  Normal 
 
 
 

Reporter:
 
 Trevor Robinson 
 
 
 
 
 
 
 
 
 
 
Hello, 
In some situations, a selector _expression_ will be ignored in favor of the statement that it's testing. This seems like an operator precedence problem. 
The following manifest should notify two lines, "I am an array",