Affects Version/s: None
Fix Version/s: None
Method Found:Needs Assessment
QA Risk Assessment:Needs Assessment
The Puppet::Property::List class, super class of Puppet::Property::OrderedList implements the method #is_to_s but does not implement #should_to_s. This leads to inconsistent representation of the current and to values when change events are reported.
The groups property of a User type can for instance present changes like:
Since the delimiter separated list is no longer quoted by default due to the changes in
PUP-7616, consequently, a list with no entries is represented as an empty string. Adding the first group to a user looks like this:
The methods #is_to_s and #should_to_s should be implemented the same way and we need to make a decision on the representation.
The property is changed to rely on default behavior (i.e. the special #is_to_s is simply removed. The result will then be that both values are represented as bracketed arrays and that the current delimiter property is rendered useless. The above changes would then instead look like:
A #should_to_s is added that is equal to #is_to_s. Both methods present a list of entries joined by the given delimiter. This list must then be quoted to avoid problem #2. The changes would then be presented as:
While this alternative vouches for a more compact presentation, it is also problematic. List is abstract and used as the parent of by many properties. The presentation will look strange if one or several entries contain:
- the delimiter
- a single quote
- a complex object
The presentation is also different from how the property is presented by commands like puppet resource, which always uses the bracketed array.