cloudsmith/geppetto — Issue #239: validate +=
Author: hlindberg
Created: 2011-11-17 23:41:24+00:00
State: open

The += operator in puppet is somewhat special since variables are read only. The += operator thus, can only work on a new variable. The validation of += should thus:

* make sure that the referenced variable is a valid reference (or there will be nothing to add to)
* make sure this variable is not already assigned to in the same context

Note that there are anomalies in the puppet language - these rules are in conflict:

* it is not possible to assign to a qualified variable
* a reference to a variable must be fully qualified if it is not in local or top scope

The following is thus not possible:

$foo::bar += ['extra']