Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-7382

Ensure current values are YAML serializable



      • puppetlabs-acl module v 1.1.2 passes CI when using a puppet-agent build with embedded Ruby 2.3
      • New unit tests added to Puppet to validate behavior
    • Agent
    • 5
    • Agent 2017-06-14
    • Bug Fix
    • Values in reports that were earlier serialized using Ruby specific YAML tags are now serialized as hashes with a special key stating the data type - thus making them valid general YAML.
    • Automate
    • Does this cause test changes?


      As described in MODULES-4275, a provider may return arbitrary objects as the current value. This value is written (as YAML) in the corrective change file and in the report (if there is a change). The assumption has always been that the current value is primitive (string, integer, etc), but the ACL module returns Hash subclasses. Since we rely on to_yaml_properties for report serialization (see PUP-7381), Ruby 2.3 will serialize instance variables of our subclasses, which causes puppet to try to serialize the provider instance. This wasn't a problem previously, because Ruby 2.2 and below just serialize the hash key/value pairs. (The commit changing the Ruby behavior is https://github.com/ruby/ruby/commit/fe0414b5473b5332706126d2a017a9bf235c8146#diff-aed2624c7e8f254dd7356f2a32d8358fR471)

      Puppet needs to be more defensive about how current values are handled. Presumably this could be done by always writing out the to_s version of the object.

      /cc geoff.nichols, ethan, henrik.lindberg


        Issue Links



              Unassigned Unassigned
              josh Josh Cooper
              Eric Delaney Eric Delaney
              0 Vote for this issue
              8 Start watching this issue



                Zendesk Support