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

handle trailing slashes in references between file resources

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 5.0.0
    • Fix Version/s: PUP 5.0.0
    • Component/s: None
    • Template:
    • Team:
      Puppet Developer Experience
    • Story Points:
      3
    • Sprint:
      PDE 2017-04-05, PDE 2017-04-19
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Certain combination of references to File resources where title and reference were not the same with respect to use of a trailing '/' could cause a reference to not be resolved and resulting in an error. This is now fixed.
    • QA Risk Assessment:
      No Action
    • QA Risk Assessment Reason:
      covered by unit tests; existing acceptance

      Description

      This change:
      https://github.com/puppetlabs/puppet/commit/3577fc913373f05b6c58fd7389e097ba7271c147/lib/puppet/parser/compiler/catalog_validator/relationship_validator.rb#diff-0

      changed the legal relationships between file resources with trailing slashes. Specifically, this manifest

      file {"/home/wyatt/foo":
        ensure => directory,
        require => File["/home/wyatt/foo/"],
      }
      

      will compile on Puppet < 5, and store a catalog in PuppetDB, while presenting an error to the user about a circular dependency. On Puppet 5, the same catalog will fail compilation because it is considering the path with the trailing slash to be different than the one in the resource title, meaning the referenced resource is considered missing. Consequently, the catalog is not stored in PuppetDB.

      This issue was caught by the PuppetDB spec tests around this case here:
      https://github.com/puppetlabs/puppetdb/blob/master/puppet/spec/unit/indirector/catalog/puppetdb_spec.rb#L623

      After talking it over with Henrik Lindberg, we determined that the tests should probably be ported to Puppet and that Puppet compilation needs to handle the trailing slash in a backwards compatible way.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                wyatt Wyatt Alt
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support