Feature #2818

case statements dont support undef

Added by Dan Bode about 2 years ago. Updated about 2 years ago.

Status:Closed Start date:11/14/2009
Priority:Normal Due date:
Assignee:James Turnbull % Done:

0%

Category:language
Target version:2.6.0
Affected Puppet version:0.25.1 Branch:tickets/master/2818
Keywords:behaviourchange
Votes: 0

Description

undef vars can be used in if-else statements

$foo1 = undef
if($foo1) {
  $bar1 = "def"
} else {
  $bar1 = "undef"
}
notice($bar1)

but not in a conditionals

$foo2 = undef
$bar2 = $foo2 ? {
  undef => "not defined",
  default => "defined"
}
warning $bar2

History

Updated by James Turnbull about 2 years ago

  • Category set to language
  • Status changed from Unreviewed to Investigating
  • Assignee set to Brice Figureau
  • Target version set to 2.6.0

Updated by Brice Figureau about 2 years ago

Note: this is not a regression, 0.24.8 behaves the same.

Updated by Brice Figureau about 2 years ago

See my patch in puppet-dev. The fix introduces a change of behavior which should be discussed.

Updated by Brice Figureau about 2 years ago

  • Status changed from Investigating to In Topic Branch Pending Review
  • Branch set to tickets/master/2818

Brice Figureau wrote:

See my patch in puppet-dev. The fix introduces a change of behavior which should be discussed.

The patch is also available in tickets/master/2818 in my github repository: http://github.com/masterzen/puppet/tree/tickets/master/2818

Updated by James Turnbull about 2 years ago

  • Status changed from In Topic Branch Pending Review to Code Insufficient

From the discussion on the -dev list I am presuming this patch needs changes?

Updated by Brice Figureau about 2 years ago

  • Status changed from Code Insufficient to Ready For Checkin
  • Assignee changed from Brice Figureau to James Turnbull

Hi,

I’ve finished and rebased the code for Rowlf. It has been approved (about 2 weeks ago). Code is still in the tickets/master/2818 branch in my github repository: http://github.com/masterzen/puppet/tree/tickets/master/2818

Updated by James Turnbull about 2 years ago

  • Status changed from Ready For Checkin to Closed
  • Keywords set to behaviourchange

Pushed in commit:53869e99149be0f60b4e415d061a76ab5421eadb in branch 0.25.x

Also available in: Atom PDF