Issue #9652 has been reported by Clay Caviness.

----------------------------------------
Bug #9652: execs with newlines fail
https://projects.puppetlabs.com/issues/9652

Author: Clay Caviness
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


If the `command`, `unless`, or `onlyif` parameters of an exec resource contain 
a newline, the parameter will fail.

    $ puppet --version
    2.7.4
    $ puppet apply --debug
    exec { "single_line":
      command => "/usr/bin/true ; /usr/bin/true",
    }
    exec { "multi_line":
      command => "/usr/bin/true ;
                  /usr/bin/true",
    }
    debug: Puppet::Type::Exec::ProviderWindows: feature microsoft_windows is 
missing
    debug: Creating default schedules
    debug: Failed to load library 'selinux' for feature 'selinux'
    debug: Puppet::Type::File::ProviderMicrosoft_windows: feature 
microsoft_windows is missing
    debug: Failed to load library 'shadow' for feature 'libshadow'
    debug: /File[/Users/crc/.puppet/var/log]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: /File[/Users/crc/.puppet/var/client_data]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: /File[/Users/crc/.puppet/var/state/graphs]: Autorequiring 
File[/Users/crc/.puppet/var/state]
    debug: /File[/Users/crc/.puppet/ssl/certs]: Autorequiring 
File[/Users/crc/.puppet/ssl]
    debug: /File[/Users/crc/.puppet/var/state/state.yaml]: Autorequiring 
File[/Users/crc/.puppet/var/state]
    debug: /File[/Users/crc/.puppet/var/state/last_run_report.yaml]: 
Autorequiring File[/Users/crc/.puppet/var/state]
    debug: /File[/Users/crc/.puppet/ssl]: Autorequiring File[/Users/crc/.puppet]
    debug: /File[/Users/crc/.puppet/ssl/public_keys]: Autorequiring 
File[/Users/crc/.puppet/ssl]
    debug: /File[/Users/crc/.puppet/ssl/certificate_requests]: Autorequiring 
File[/Users/crc/.puppet/ssl]
    debug: /File[/Users/crc/.puppet/var/run]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: /File[/Users/crc/.puppet/ssl/private]: Autorequiring 
File[/Users/crc/.puppet/ssl]
    debug: /File[/Users/crc/.puppet/var/clientbucket]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: /File[/Users/crc/.puppet/ssl/private_keys]: Autorequiring 
File[/Users/crc/.puppet/ssl]
    debug: /File[/Users/crc/.puppet/var/facts]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: /File[/Users/crc/.puppet/var/state/last_run_summary.yaml]: 
Autorequiring File[/Users/crc/.puppet/var/state]
    debug: /File[/Users/crc/.puppet/var/state]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: /File[/Users/crc/.puppet/var]: Autorequiring File[/Users/crc/.puppet]
    debug: /File[/Users/crc/.puppet/var/lib]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: /File[/Users/crc/.puppet/var/client_yaml]: Autorequiring 
File[/Users/crc/.puppet/var]
    debug: Finishing transaction 2164878120
    debug: Loaded state in 0.00 seconds
    debug: Loaded state in 0.00 seconds
    info: Applying configuration version '1316714514'
    debug: /Schedule[never]: Skipping device resources because running on a host
    debug: /Schedule[daily]: Skipping device resources because running on a host
    debug: /Schedule[monthly]: Skipping device resources because running on a 
host
    debug: /Schedule[puppet]: Skipping device resources because running on a 
host
    debug: /Schedule[hourly]: Skipping device resources because running on a 
host
    debug: Exec[single_line](provider=posix): Executing '/usr/bin/true ; 
/usr/bin/true'
    debug: Executing '/usr/bin/true ; /usr/bin/true'
    notice: /Stage[main]//Exec[single_line]/returns: executed successfully
    debug: /Stage[main]//Exec[single_line]: The container Class[Main] will 
propagate my refresh event
    debug: /Schedule[weekly]: Skipping device resources because running on a 
host
    debug: Exec[multi_line](provider=posix): Executing '/usr/bin/true ;
    /usr/bin/true'
    debug: Executing '/usr/bin/true ;
    /usr/bin/true'
    err: /Stage[main]//Exec[multi_line]/returns: change from notrun to 0 
failed: /usr/bin/true ;
    /usr/bin/true returned 1 instead of one of [0] at line 7
    debug: Class[Main]: The container Stage[main] will propagate my refresh 
event
    debug: Finishing transaction 2165610600
    debug: Storing state
    debug: Stored state in 0.01 seconds
    notice: Finished catalog run in 0.18 seconds
    debug: Finishing transaction 2165076560
    debug: Recieved report to process from fox.nyc.corp.google.com
    debug: Processing report from fox.nyc.corp.google.com with processor 
Puppet::Reports::Store
     

Verified on Mac OS X 10.6.8 running puppet 2.7.4rc3. These execs with newlines 
worked properly in 2.7.3 and earlier.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to