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

Tag fields in reports accidentally changed to Puppet::Util::TagSet objects

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.4.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      2
    • Sprint:
      Client 2016-03-09
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Starting from Puppet 4.0, the YAML report output did not match the documentation for our report format. Now it matches.

      Description

      Puppet reports contain `tags` fields in each Puppet::Util::Log and Puppet::Resource::Status object; these fields are supposed to be arrays of strings.

      In Puppet 4.0.0, the tags fields in a YAML-dumped Puppet::Transaction::Report object changed from arrays to Puppet::Util::TagSets, as described in DOCUMENT-436. This was a side-effect of:

      commit 7b0eed2b52bad0d5c3fc3a9fbe37d097eabc9fc2
      Author: Britt Gresham <britt@puppetlabs.com>
      Date:   Wed Nov 12 09:17:30 2014 -0800
       
          (PUP-1019) Remove ZAML
       
          Before this commit we were using ZAML by monkey patching the `to_yaml`
          function to use ZAML.dump instead of YAML.dump. After removing `zaml.rb`
          tests started failing because of the way that ZAML serialized YAML so
          assertions in those tests were changed.
       
          This commit also adds in a patch to YAML.Psych to handle the cases where
          ruby objects were being encoded improperly.
       
          This commit removes the use of ZAML in puppet as part of the Puppet 4.x
          code removal efforts.
      

      diff --git a/lib/puppet/util/tag_set.rb b/lib/puppet/util/tag_set.rb
      index e74f228..613859d 100644
      --- a/lib/puppet/util/tag_set.rb
      +++ b/lib/puppet/util/tag_set.rb
      @@ -24,12 +24,6 @@ class Puppet::Util::TagSet < Set
           to_data_hash.to_pson
         end
       
      -  # this makes puppet serialize it as an array for backwards
      -  # compatibility
      -  def to_zaml(z)
      -    to_data_hash.to_zaml(z)
      -  end
      -
         def join(*args)
           to_a.join(*args)
         end
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              nick.fagerlund Nicholas Fagerlund
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support