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

Also available in: Atom PDF