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

puppet generate types for environment isolation generates invalid code

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 4.9.2
    • PUP 4.10.0
    • None
    • None
    • Puppet Developer Experience
    • 2
    • PDE 2017-03-22, PDE 2017-04-05
    • Bug Fix
    • 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.
    • No Action
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support