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

Error with noop run when file has require and source that doesn't exist

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Won't Do
    • None
    • None
    • None
    • puppet enterprise 3.0

    Description

      The following manifest fails when run with --noop, but succeeds when run normally:

      t.pp

      file { '/tmp/foo-bar':
        content => "Hello\n",
      }
       
      file { '/tmp/bar-foo':
        source => "file:///tmp/foo-bar",
        require => File['/tmp/foo-bar'],
      }
      

      $ rm -rf /tmp/foo-bar /tmp/bar-foo; puppet apply t.pp 
      Notice: Compiled catalog for swillis-macbook-pro.local in environment production in 0.12 seconds
      Notice: /Stage[main]/Main/File[/tmp/foo-bar]/ensure: defined content as '{md5}09f7e02f1290be211da707a266f153b3'
      Notice: /Stage[main]/Main/File[/tmp/bar-foo]/ensure: defined content as '{md5}09f7e02f1290be211da707a266f153b3'
      Notice: Finished catalog run in 0.06 seconds
      $ rm -rf /tmp/foo-bar /tmp/bar-foo; puppet apply --noop t.pp 
      Notice: Compiled catalog for swillis-macbook-pro.local in environment production in 0.12 seconds
      Notice: /Stage[main]/Main/File[/tmp/foo-bar]/ensure: current_value absent, should be file (noop)
      Error: /Stage[main]/Main/File[/tmp/bar-foo]: Could not evaluate: Could not retrieve information from environment production source(s) file:///tmp/foo-bar
      Notice: Class[Main]: Would have triggered 'refresh' from 1 events
      Notice: Stage[main]: Would have triggered 'refresh' from 1 events
      Notice: Finished catalog run in 0.05 seconds
      

      A resource (in this case: file) should not fail when run under noop just because one of its predicates (in this case: its source existing) isn't true. Especially when the resource has a require which very well may end up satisfying the predicate.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              swillis@compete.com Steven Willis
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support