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

Ensure current values are YAML serializable

    XMLWordPrintable

    Details

    • Template:
    • Acceptance Criteria:
      • 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
    • Sub-team:
    • Team:
      Agent
    • Story Points:
      5
    • Sprint:
      Agent 2017-06-14
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      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.
    • QA Risk Assessment:
      Automate
    • QA Risk Assessment Reason:
      Does this cause test changes?

      Description

      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 Brown, Henrik Lindberg

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              josh Josh Cooper
              QA Contact:
              Eric Delaney Eric Delaney
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support