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

Heredoc with hyphen strips extra newlines

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PUP 4.10.8, PUP 5.3.1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Puppet 5.1.0
      OS X 10.12.6

    • Template:
    • Acceptance Criteria:
      Hide

      With suppression (-END)

      ❯ cat test.pp 
      notice(@(END))
      line1
      line2
       
      line4
      -END
      ❯ puppet apply test.pp
      Notice: Scope(Class[main]): line1
      line2
       
      line4
      Notice: Compiled catalog for marla.local in environment production in 0.03 seconds
      Notice: Applied catalog in 0.01 seconds
      

      Show
      With suppression (-END) ❯ cat test.pp notice(@(END)) line1 line2   line4 -END ❯ puppet apply test.pp Notice: Scope(Class[main]): line1 line2   line4 Notice: Compiled catalog for marla.local in environment production in 0.03 seconds Notice: Applied catalog in 0.01 seconds
    • Team:
      Platform Core
    • Story Points:
      1
    • Method Found:
      Customer Feedback
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      When a heredoc ended with a tag preceeded by '-' (minus) to indicate that the final newline should be removed from the result, not only did it remove the last newline, but also reduce all multiple empty lines into single empty lines in the entire text. This is now fixed so only the single last trailing newline is removed.
      Show
      When a heredoc ended with a tag preceeded by '-' (minus) to indicate that the final newline should be removed from the result, not only did it remove the last newline, but also reduce all multiple empty lines into single empty lines in the entire text. This is now fixed so only the single last trailing newline is removed.
    • QA Risk Assessment:
      Needs Assessment

      Description

      A heredoc set to suppress the final line break also converts double line breaks into single line breaks.

      Without suppression (END)

      ❯ cat test.pp 
      notice(@(END))
      line1
      line2
       
      line4
      END
      ❯ puppet apply test.pp 
      Notice: Scope(Class[main]): line1
      line2
       
      line4
       
      Notice: Compiled catalog for marla.local in environment production in 0.03 seconds
      Notice: Applied catalog in 0.01 seconds
      

      With suppression (-END)

      ❯ cat test.pp 
      notice(@(END))
      line1
      line2
       
      line4
      -END
      ❯ puppet apply test.pp
      Notice: Scope(Class[main]): line1
      line2
      line4
      Notice: Compiled catalog for marla.local in environment production in 0.03 seconds
      Notice: Applied catalog in 0.01 seconds
      

      -END should only supress the final line break.

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                daniel.parks Daniel Parks
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: