Uploaded image for project: 'Puppet Development Kit'
  1. Puppet Development Kit
  2. PDK-1198

Complex string breaks puppet-lint

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDK 1.14.0
    • Component/s: puppet-lint
    • Labels:
    • Template:
    • Team:
      Puppet Developer Experience
    • Method Found:
      Needs Assessment
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      Will be covered in puppet-lint changelog
    • QA Risk Assessment:
      Needs Assessment

      Description

      While testing https://github.com/puppetlabs/puppetlabs-modules/pull/8181 I found that at least three nodes with complex strings like the one below all threw syntax errors when checked by puppet-lint.

      $proxy_servers    = puppetdb_query("inventory { resources { type = 'Class' and title = 'Profile::Websites::Loadbalancer' } and facts.classification.group = '${facts['classification']['group']}' and facts.classification.stage = '${facts['classification']['stage']}' and facts.whereami = '${facts['whereami']}' }").map |$value| { $value['facts']["ipaddress_${facts['primary_iface']}"] }, 

      I am fairly certain that the use of interpolation in the middle of a string that includes single quotes is the issue though I can't say for certain. Basically, I think its getting confused about where the double-quotes start and end.

      I am going to try and work around this by refactoring our code but having to work around this limitation of puppet-lint is currently blocking the merging of a PR and thereby costing me a fair amount of time in both debugging and refactoring code.

        Attachments

          Activity

            People

            Assignee:
            tim.sharpe Tim Sharpe
            Reporter:
            gene.liverman Gene Liverman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support