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

Fix broken implementation of Property#change_to_s method

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 5.0.0
    • Component/s: None
    • Template:
    • Sub-team:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-06-14
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Change reports describing a change in a Resource Property "from" - "to" would output structured data for "from" but not for "to"; which was always shrinkwrapped into an awkward string representation. Now the "to" in a property change report is formatted in the same structured was as the "from".
      Show
      Change reports describing a change in a Resource Property "from" - "to" would output structured data for "from" but not for "to"; which was always shrinkwrapped into an awkward string representation. Now the "to" in a property change report is formatted in the same structured was as the "from".
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      Check in includes tests for the change

      Description

      The method Puppet::Property#change_to_s, which is used when constructing the message of an event, is broken. It calls the methods #is_to_s and #should_to_s to convert values to their string form and then calls #format_value_for_display to convert that string again.

      Sometimes this almost works since the default implementation of the method #is_to_s just returns it's argument untouched (the documentation states that it produces a "pretty printing string", but it doesn't) so that two wrongs ends up as one right. The default for #should_to_s will however always convert its argument using default ruby string conversion (it converts to an array and joins with space).

      This should be fixed so that the #change_to_s just calls #is_to_s and #should_to_s and the default implementation them then calls #format_value_for_display.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              qa qa
              Reporter:
              thomas.hallgren Thomas Hallgren
              QA Contact:
              Eric Delaney
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support