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

puppet generate types for environment isolation generates invalid code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.9.2
    • Fix Version/s: PUP 4.10.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Epic Link:
    • Team:
      Puppet Developer Experience
    • Story Points:
      2
    • Sprint:
      PDE 2017-03-22, PDE 2017-04-05
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Hide
      Complex regular expressions output by puppet generate types could be too complex for the puppet language lexer. The lexer would then not recognize the token as a regexp and would then cause a syntax error on the opening '/'. This was caused by the puppet language lexer not allowing new lines in the regular expression. They are now allowed.
      Show
      Complex regular expressions output by puppet generate types could be too complex for the puppet language lexer. The lexer would then not recognize the token as a regexp and would then cause a syntax error on the opening '/'. This was caused by the puppet language lexer not allowing new lines in the regular expression. They are now allowed.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests

      Description

      Ticket created based on comment from Henrik Lindberg (SERVER-94?focusedCommentId=385558) and Eric Sorenson (SERVER-94?focusedCommentId=388535)

      I encountered the following problem with the https://github.com/theforeman/puppet-foreman module:

      puppet parser validate /tmp/.resource_types/foreman_smartproxy.pp
       
      Error: Could not parse for environment production: Syntax error at '/' at /tmp/.resource_types/foreman_smartproxy.pp:34:37
      

      I attached the generated file to this ticket.
      What I can gather is that the ruby internal URI.regexp pattern from the foreman module (https://github.com/theforeman/puppet-foreman/blob/master/lib/puppet/type/foreman_smartproxy.rb#L33) does create a pattern which the Puppetserver then refuses to accept.

      Now I'm not sure if
      (a) the puppet generate did something wrong with the URI.regexp or
      (b) the guys from the foreman-puppet module should change something.

      Github issue link to the puppet-foreman project: https://github.com/theforeman/puppet-foreman/issues/512

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            xorpaul Andreas Paul
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support