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

REGRESSION exec cwd is not respected for unless or onlyif commands in 6.0.1

    XMLWordPrintable

Details

    • Platform OS
    • Platform OS Kanban
    • Needs Assessment
    • Bug Fix
    • The unless or onlyif commands now respect the cwd parameter in the Exec resource.
    • Needs Assessment

    Description

      Since 6.0.1 there is a pretty severe regression which makes unless & onlyif of the exec resource not respecting the specified cwd.

      Here is the (shortened output of a run in 6.0.0:

       

      $ puppet apply --debug <<EOF
      exec{'/usr/bin/pwd':
        onlyif    => '/usr/bin/pwd',
        cwd       => '/tmp',
        logoutput => true,
      }
      EOF
      Debug: Runtime environment: puppet_version=6.0.0, ruby_version=2.5.1, run_mode=user, default_encoding=UTF-8
       
      [...]
       
      Info: Applying configuration version '1538554714'
      Debug: Exec[/usr/bin/pwd](provider=posix): Executing check '/usr/bin/pwd'
      Debug: Executing: '/usr/bin/pwd'
      Debug: /Stage[main]/Main/Exec[/usr/bin/pwd]/onlyif: /tmp
      Debug: Exec[/usr/bin/pwd](provider=posix): Executing '/usr/bin/pwd'
      Debug: Executing: '/usr/bin/pwd'
      Notice: /Stage[main]/Main/Exec[/usr/bin/pwd]/returns: /tmp
      Notice: /Stage[main]/Main/Exec[/usr/bin/pwd]/returns: executed successfully
      Debug: /Stage[main]/Main/Exec[/usr/bin/pwd]: The container Class[Main] will propagate my refresh event

       

      While this is the output from a 6.0.1 run:

       
       $puppet apply --debug <<EOF
      > exec{'/usr/bin/pwd':
      >   onlyif    => '/usr/bin/pwd',
      >   cwd       => '/tmp',
      >   logoutput => true,
      > }
      > EOF
      Debug: Runtime environment: puppet_version=6.0.1, ruby_version=2.5.1, run_mode=user, default_encoding=UTF-8
       
      [...]
       
      Debug: Exec[/usr/bin/pwd](provider=posix): Executing check '/usr/bin/pwd'
      Debug: Executing: '/usr/bin/pwd'
      Debug: /Stage[main]/Main/Exec[/usr/bin/pwd]/onlyif: /root
      Debug: Exec[/usr/bin/pwd](provider=posix): Executing '/usr/bin/pwd'
      Debug: Executing: '/usr/bin/pwd'
      Notice: /Stage[main]/Main/Exec[/usr/bin/pwd]/returns: /tmp
      Notice: /Stage[main]/Main/Exec[/usr/bin/pwd]/returns: executed successfully
      Debug: /Stage[main]/Main/Exec[/usr/bin/pwd]: The container Class[Main] will propagate my refresh event
      

       

      This is a pretty severe Regression as it breaks tons of existing execs, which might even trigger unwanted commands, as the safeguards are not working anymore.

      Attachments

        Activity

          People

            enis.inan Enis Inan
            duritong Peter Meier
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support