Issue #4804 has been updated by Markus Roberts.

Status changed from Accepted to Ready for Testing
Branch set to http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/4804

When searching for string-segment terminators (closing quotes or 
interpolations) the test was "preceded by 0 backslashes" when it should have 
been "preceded by an even number of backslashes." 


----------------------------------------
Bug #4804: Puppetmaster is not parsing a sed command with "a\\$line" in it 
correctly
http://projects.puppetlabs.com/issues/4804

Author: Chuck Schweizer
Status: Ready for Testing
Priority: Normal
Assignee: Markus Roberts
Category: 
Target version: 2.6.2
Affected version: 2.6.1
Keywords: 
Branch: http://github.com/MarkusQ/puppet/tree/ticket/2.6.x/4804


Looks like the parser on the 2.6.1 puppetmaster is not dealing with the 
`a\\${line}` correctly in this code.  This code works correctly on a 0.25.5 
puppetmaster.  Notice that it is not replacing the ${line} as it was on the 
0.25.5 puppetmaster.

Here is the error

    err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate definition: Exec[/bin/sed -i '/\[components\]/ a\${line}' 
/opt/data/trac/sandbox/conf/trac.ini] is already defined in file 
/var/opt/puppet/environments/production/modules/trac/manifests/definitions/tracini.iv1_0.pp
 at line 20; cannot redefine at 
/var/opt/puppet/environments/production/modules/trac/manifests/definitions/tracini.iv1_0.pp:20
 on node client1


Here is the code

    define trac::tracinicomponentline($line, $file) {
      exec { "/bin/sed -i /\\[components\\]/ a\\${line} ${file}":
          unless => "/bin/grep -Fx '${line}' '${file}'"
      }
    }
    


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