Re: [Puppet Users] Unrecognised escape sequences

2011-02-09 Thread M C
Hi,

it aint our issue: we dont actually need to include escape chars into
strings, our need is - for example - to escape delimitators ( , ' ) inside
command lines; in fact ,we're used to compose very complex tiny scripts with
subshells for the 'command' field into 'exec' resources, etc..

Please help,
greets,
Matteo

2011/2/9 Felix Frank felix.fr...@alumni.tu-berlin.de

 On 02/08/2011 04:09 PM, mt321_0987 wrote:
  unfortunately, we keep getting this warns into the system log by
  puppet masters:
 
   [...] Unrecognised escape sequence '\CHAR' in file PATH [...] 
 
  but then everything works fine; also, without using escapes, catalogs
  dont work on agents.
  What can we do to avoid these kind of errors in master syslogs?
 
  Please ,let us know ASAP and tell us if this problem will prevent
  remote execution in future versions, thanks

 If you have strings that include backslashes, you should really escape
 those backslashes, i.e.:

  onlyif = grep two\ words /tmp/file, # WRONG!

  onlyif = grep two\\ words /tmp/file, # right

 In some cases, you can use single quotes instead

  onlyif = 'grep two\ words /tmp/file', # right too

 but you loose flexibility. I urge you to get your escapes right.

 HTH,
 Felix

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unrecognised escape sequences

2011-02-09 Thread Felix Frank
On 02/09/2011 12:13 PM, M C wrote:
 Hi,
 
 it aint our issue: we dont actually need to include escape chars into
 strings, our need is - for example - to escape delimitators ( , ' )
 inside command lines; in fact ,we're used to compose very complex tiny
 scripts with subshells for the 'command' field into 'exec' resources, etc..

My comment was not targeted at escaping specific characters. Whatever
you escape, if you want puppet to transfer a backslash to the client,
and the string containing that backslash is double-quoted in your
manifest, you should escape that backslash and avoid any ambiguity.

Regards,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unrecognised escape sequences

2011-02-09 Thread M C
Hi,

the problem we are facing is not the transfer of backslash
escape+non-specific character; we need puppet not to log the warns into the
syslog when catalogs are prepared and commands such as

command  =  /bin/echo \\$(echo bin)\,

are processed for compiling

Our syslogs are full of  [...] Unrecognised escape sequence '\non-specific
character' [...] 

Please help, thanks
Greets,
Matteo

2011/2/9 Felix Frank felix.fr...@alumni.tu-berlin.de

 On 02/09/2011 12:13 PM, M C wrote:
  Hi,
 
  it aint our issue: we dont actually need to include escape chars into
  strings, our need is - for example - to escape delimitators ( , ' )
  inside command lines; in fact ,we're used to compose very complex tiny
  scripts with subshells for the 'command' field into 'exec' resources,
 etc..

 My comment was not targeted at escaping specific characters. Whatever
 you escape, if you want puppet to transfer a backslash to the client,
 and the string containing that backslash is double-quoted in your
 manifest, you should escape that backslash and avoid any ambiguity.

 Regards,
 Felix

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unrecognised escape sequences

2011-02-09 Thread Felix Frank
On 02/09/2011 01:22 PM, M C wrote:
 Hi,
 
 the problem we are facing is not the transfer of backslash
 escape+non-specific character; we need puppet not to log the warns into
 the syslog when catalogs are prepared and commands such as
 
 command  =  /bin/echo \\$(echo bin)\,
 
 are processed for compiling
 
 Our syslogs are full of  [...] Unrecognised escape sequence
 '\non-specific character' [...] 

The above line is giving you this warning? Please make double-sure.
There are lot of cases where this warning is justified, but the above
line should *not* generate it, as all of those sequences should be
recognized.

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unrecognised escape sequences

2011-02-09 Thread M C
Hi,

thank you verymuch.

Matteo

2011/2/9 Felix Frank felix.fr...@alumni.tu-berlin.de

 On 02/09/2011 01:22 PM, M C wrote:
  Hi,
 
  the problem we are facing is not the transfer of backslash
  escape+non-specific character; we need puppet not to log the warns into
  the syslog when catalogs are prepared and commands such as
 
  command  =  /bin/echo \\$(echo bin)\,
 
  are processed for compiling
 
  Our syslogs are full of  [...] Unrecognised escape sequence
  '\non-specific character' [...] 

 The above line is giving you this warning? Please make double-sure.
 There are lot of cases where this warning is justified, but the above
 line should *not* generate it, as all of those sequences should be
 recognized.

 --
 You received this message because you are subscribed to the Google Groups
 Puppet Users group.
 To post to this group, send email to puppet-users@googlegroups.com.
 To unsubscribe from this group, send email to
 puppet-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/puppet-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.



Re: [Puppet Users] Unrecognised escape sequences

2011-02-08 Thread Felix Frank
On 02/08/2011 04:09 PM, mt321_0987 wrote:
 unfortunately, we keep getting this warns into the system log by
 puppet masters:
 
  [...] Unrecognised escape sequence '\CHAR' in file PATH [...] 
 
 but then everything works fine; also, without using escapes, catalogs
 dont work on agents.
 What can we do to avoid these kind of errors in master syslogs?
 
 Please ,let us know ASAP and tell us if this problem will prevent
 remote execution in future versions, thanks

If you have strings that include backslashes, you should really escape
those backslashes, i.e.:

 onlyif = grep two\ words /tmp/file, # WRONG!

 onlyif = grep two\\ words /tmp/file, # right

In some cases, you can use single quotes instead

 onlyif = 'grep two\ words /tmp/file', # right too

but you loose flexibility. I urge you to get your escapes right.

HTH,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
Puppet Users group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.