Issue #7752 has been updated by Luc Suryo.

FYI

This was taking from 
http://projects.puppetlabs.com/projects/1/wiki/Simple_Text_Patterns

Would be nice if the example it fixed ;)

for comment :
command => "sed -i -e'/${line}/s/^\\(.\\+\\)$/#\\1/' '${file}'",


for uncomment:
command => "sed -i -e'/${line}/s/^#\\+//' '${file}'",

case closed...
thanks!
----------------------------------------
Bug #7752: Unrecognised escape sequence
https://projects.puppetlabs.com/issues/7752

Author: Luc Suryo
Status: Investigating
Priority: Normal
Assignee: 
Category: cron
Target version: 
Affected Puppet version: 2.6.3
Keywords: 
Branch: 


This happend for cron as well for exec !

consider the followings

    cron { "fake_test" :
            command => "find /data -type f -name \*log -exec ls -l {} \; > 
/dev/null 2>&1",
            user => "root",
            hour => "0",
            minute => "0",
            ensure => "present",
    }

AND

    define fly::comment ( $file, $line ) {
        Exec {
                logoutput => "on_failure",
                path => [ "/bin", "/usr/bin", "/sbin", "/usr/sbin", 
"/usr/local/bin", "/usr/local/sbin" ],
        }

        exec { "comment-$name" :
                command => "sed -i -e'/${line}/s/^\ (.\+\)$/#\1/' '${file}'",
                onlyif => "test `grep '${line}' '${file}' | grep -v '^#' | wc 
-l` -ne 0",
                user => "root",
                refreshonly => "false",
        }
    }

message in the log file :

for cron:

    Jun  1 18:06:08 noc01 puppet-master[1993]: Unrecognised escape sequence 
'\;' in file /data/lib/puppet/fly/modules/fly-cron/manifests/fly-cron::noc.pp 
at line 344


for exec:

    Jun  1 18:06:07 noc01 puppet-master[1993]: Unrecognised escape sequence '\ 
' in file /data/lib/puppet/modules/fly/manifests/fly::comment.pp at line 35
    Jun  1 18:06:07 noc01 puppet-master[1993]: Unrecognised escape sequence 
'\+' in file /data/lib/puppet/modules/fly/manifests/fly::comment.pp at line 35
    Jun  1 18:06:07 noc01 puppet-master[1993]: Unrecognised escape sequence 
'\)' in file /data/lib/puppet/modules/fly/manifests/fly::comment.pp at line 35
    Jun  1 18:06:07 noc01 puppet-master[1993]: Unrecognised escape sequence 
'\1' in file /data/lib/puppet/modules/fly/manifests/fly::comment.pp at line 35
    Jun  1 18:06:07 noc01 puppet-master[1993]: Unrecognised escape sequence 
'\+' in file /data/lib/puppet/modules/fly/manifests/fly::uncomment.pp at line 35

and yet the crontab is cerated and is correct and the exec is executed 
correctly  too!

ENV : ubuntu on EC2 / Passenger 3.0;7 / Nginx 1.0.0 / Rack 1.0.3

Thanks

-ls



-- 
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