Project

General

Profile

Actions

Bug #2191

closed

No distinction between no param default and "undef" default

Added by Dominic Cleal about 11 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Puppet
Target version:
Difficulty:
Triaged:
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.

Actions #1

Updated by Dominic Cleal about 11 years ago

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

Updated by Dominic Cleal about 11 years ago

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

Updated by Dominic Cleal almost 11 years ago

  • Target version changed from 26 to 1.2.0
Actions #4

Updated by Greg Sutcliffe almost 6 years ago

  • Target version deleted (1.2.0)
Actions

Also available in: Atom PDF