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

A failed exec doesn't get reported as failure if refreshonly is true

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: PUP 3.4.0
    • Fix Version/s: None
    • Component/s: Types and Providers
    • Labels:
      None
    • Environment:

      CentOS 6.2 x86_64, CentOS 6.5 x86_64

    • Template:

      Description

      When an exec resource has refreshonly=>true, and gets triggered by another resource, and if the exec fails (returns non-zero), it does not get reported as a failure. If refreshonly=>false, and exec returns non-zero, then it properly gets reported as a failure.

      Test class:

      class testmodule {
      file

      { '/tmp/testfile': ensure => file, content => 'test1', }

      exec

      { '/bin/false': subscribe => File['/tmp/testfile'], refreshonly => true, }

      }

      The yaml reports:
      with refreshonly=>true and failure not reported
      Exec[/bin/false]: !ruby/object:Puppet::Resource::Status
      resource: Exec[/bin/false]
      file: /etc/puppet/modules/testmodule/manifests/init.pp
      line: 11
      evaluation_time: 0.000323
      change_count: 0
      out_of_sync_count: 0
      tags:

      • exec
      • testmodule
      • class
        time: 2013-12-21 23:48:25.950886 -06:00
        events: []
        out_of_sync: false
        changed: false
        resource_type: Exec
        title: /bin/false
        skipped: false
        failed: false
        containment_path:
      • Stage[main]
      • Testmodule
      • Exec[/bin/false]

      with refreshonly=>false and failure reported
      Exec[/bin/false]: !ruby/object:Puppet::Resource::Status
      resource: Exec[/bin/false]
      file: /etc/puppet/modules/testmodule/manifests/init.pp
      line: 11
      evaluation_time: 0.073655
      change_count: 0
      out_of_sync_count: 1
      tags:

      • exec
      • testmodule
      • class
        time: 2013-12-22 00:21:44.311131 -06:00
        events:
      • !ruby/object:Puppet::Transaction::Event
        audited: false
        property: returns
        previous_value: notrun
        desired_value:
      • "0"
        historical_value:
        message: "change from notrun to 0 failed: /bin/false returned 1 instead of one of [0]"
        name: !ruby/sym executed_command
        status: failure
        time: 2013-12-22 00:21:44.384329 -06:00
        out_of_sync: true
        changed: false
        resource_type: Exec
        title: /bin/false
        skipped: false
        failed: true
        containment_path:
      • Stage[main]
      • Testmodule
      • Exec[/bin/false]

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  pryszkie Peter Ryszkiewicz
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: