Project

General

Profile

Bug #2191

No distinction between no param default and "undef" default

Added by Dominic Cleal over 6 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet
Target version:
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

A class declaration can have a parameter with no default:

class foo($bar)

Or an undef default:

class foo($bar = undef)

Both are returned from the proxy as having a nil value for the parameter, however the second case is an actual valid default value for the parameter. The class will run correctly if included without specifying this parameter, as it defaults to undef.

Proxy output:

{"foo":{"params":{"bar":null},"module":null,"name":"foo"}}

Due to the null returned by the proxy, Foreman interprets both cases as it being a required parameter and so forces a value. If no value is given, then Foreman returns the parameter in the ENC output but with no value (bar:) which causes Puppet to state:

Error: Received incomplete information - no value provided for parameter bar on node ...

Better module design would be to use UNSET or similar as a default value anyway.

Associated revisions

Revision dd7018f8 (diff)
Added by Dominic Cleal over 6 years ago

fixes #2191 - undef in puppet class params is optional

History

#1 Updated by Dominic Cleal over 6 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Dominic Cleal
  • Target version set to 26

#2 Updated by Dominic Cleal over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Dominic Cleal over 6 years ago

  • Target version changed from 26 to 1.2.0

#4 Updated by Greg Sutcliffe about 1 year ago

  • Target version deleted (1.2.0)

Also available in: Atom PDF