Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Jacob Helwig commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes This was merged to 5.5.x in https://github.com/puppetlabs/puppet/commit/8010eef96deef702b225bbd0ca4c3eca77cbe9da Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title David Lutterkort updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: David Lutterkort Release Notes Summary: The Augeas provider did not unescape quotes in quoted arguments for {{set}} and similar commands. Putting the command {{set thing "\"my stuff\""}} would lead to {{thing}} having the value {{\"my stuff\"}}, including the backslashes. Those backslashes are now properly removed so that the above command leads to {{thing}} having the value {{"my stuff"}}. Release Notes: Bug Fix Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Kenn Hussey commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes David Lutterkort please add release notes for this issue, if needed. Thanks! Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Henrik Lindberg assigned an issue to Unassigned Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Henrik Lindberg Assignee: David Lutterkort Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Kenn Hussey updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Kenn Hussey Team: Platform Core Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Henrik Lindberg updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Henrik Lindberg Fix Version/s: PUP 5.5.1 Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Eric Sorenson commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes Seems pretty low-risk to include in 5.5. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Henrik Lindberg commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes Eric Sorenson Are you ok with treating this as a .z bugfix? If so, David Lutterkort please retarget the PR to 5.5.x branch. My only concern here is that the change could potentially (albeit unlikely) screw someone up silently and that risk is to high for a .z release. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title David Lutterkort commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes Henrik Lindberg you are right that it is a breaking change, though I think it's exceedingly unlikely that anybody will be bitten by this: to see a change in behavior, users would need to have escaped quotes in an argument to an augeas command, and wanted them to appear quoted in the output. The bugfix only changes how escaped quotes are handled. As an example, they would have to have "set thing \"my stuff\"" in their manifest, and then want the literal string \"my stuff\" (including the backslashes!) to appear in the file they are manipulating. I agree with Russell Knighton that the fact that this hasn't been reported before is a strong indicator that nobody is writing augeas resources that trigger this. I also vote for getting this out ASAP, not just for 6.0 Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes Thank you both David Lutterkort & Henrik Lindberg for looking at this and getting a fix together so quickly. I've finally managed to get 5 free minutes in which to test it, and am pleased to report that it works. As it is a bug (and I'm really really surprised no one else has encountered this before), I would seriously hope that it could be fixed ASAP (i.e. in the next point release of 5.5.n or at least 5.6.0), rather than having to wait for 6.0.0. Perhaps the fact no one appears to have reported this issue before (and also the fact that there does not appear to be a workaround for it) is a good sign that this actually isn't too big a change and that is should have minimal impact. Thanks again. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Henrik Lindberg commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes Russell Knighton Great if you have a chance to test if the PR helps solve your issue. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Henrik Lindberg commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes David Lutterkort Even if this is a bug, it is a breaking change - ok since it is targeting Puppet 6.0.0, but important to release note. Do you think there is a risk that people will be bitten by the change? i.e. if they relied on the old behavior? Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title David Lutterkort assigned an issue to David Lutterkort Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: David Lutterkort Assignee: David Lutterkort Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title David Lutterkort commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes I just posted a PR for this. Let me know if that doesn't seem to fix it for you. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title David Lutterkort commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes This is indeed a bug: what is happening is that the augeas provider lib/puppet/provider/augeas/augeas.rb dutifully recognizes escaped quote characters as part of the string, but then forgets to remove the quoting backslashes so that \" in the string gets written out as " (around line 124) I'll try to come up with a fix shortly. Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Henrik Lindberg commented on PUP-8561 Re: Augeas unable to handle escaped quotes within quotes Ping David Lutterkort Add Comment This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.To describe some of the more obvious steps I have tried, lets store the initial variables like as following:{code:puppet}#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{code}The initial most logical combination of options that I have tried are (elaborated here to try and make it clear):*Attempt 1*Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes:{code:puppet}# Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", '"', '\\"', 'G')augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code}Produces:{noformat}-log_format main '$remote_addr - $remote_user [$time_local] "$request" '- '$status $body_bytes_sent "$http_referer" '- '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}*Result:* Produces almost exactly what I want, but unfortunately the escapes have been passed through and retained. The result is confirmed when grep'ing the file:{noformat}root@devsvr2 ~]# grep log_format /etc/nginx/nginx.conflog_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}Maybe I do not need the escapes? Let's try without...*Attempt 2*Don't escape the double quotes within the
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.To describe some of the more obvious steps I have tried, lets store the initial variables like as following:{code:puppet}#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{code}The initial most logical combination of options that I have tried are (elaborated here to try and make it clear):*Attempt 1*Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes:{code:puppet}# Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", '"', '\\"', 'G' ) augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code}Produces:{noformat}-log_format main '$remote_addr - $remote_user [$time_local] "$request" '- '$status $body_bytes_sent "$http_referer" '- '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}*Result:* Produces almost exactly what I want, but unfortunately the escapes have been passed through and retained. The result is confirmed when grep'ing the file:{noformat}root@devsvr2 ~]# grep log_format /etc/nginx/nginx.conflog_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}Maybe I do not need the escapes? Let's try without...*Attempt 2*Don't escape the double quotes within t
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.To describe some of the more obvious steps I have tried, lets store the initial variables like as following:{code:puppet}#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{code}The initial most logical combination of options that I have tried are (elaborated here to try and make it clear):*Attempt 1*Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes:{code:puppet}# Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", '"', '\\"', 'G'augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code}Produces:{noformat}-log_format main '$remote_addr - $remote_user [$time_local] "$request" '- '$status $body_bytes_sent "$http_referer" '- '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}*Result:* Produces almost exactly what I want, but unfortunately the escapes have been passed through and retained. The result is confirmed when grep'ing the file:{noformat}root@devsvr2 ~]# grep log_format /etc/nginx/nginx.conflog_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}Maybe I do not need the escapes? Let's try without...*Attempt 2*Don't escape the double quotes within the
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.To describe some of the more obvious steps I have tried, lets store the initial variables like as following:{code:puppet}#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{code}The initial most logical combination of options that I have tried are (elaborated here to try and make it clear):*Attempt 1*Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes:{code:puppet}# Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", '"', '\\"', 'G'augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code}Produces:{noformat}-log_format main '$remote_addr - $remote_user [$time_local] "$request" '- '$status $body_bytes_sent "$http_referer" '- '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}*Result:* Produces almost exactly what I want, but unfortunately the escapes have been passed through and retained. The result is confirmed when grep'ing the file:{noformat}root@ dcscache-lon2 devsvr2 ~]# grep log_format /etc/nginx/nginx.conflog_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}Maybe I do not need the escapes? Let's try without...*Attempt 2*Don't escape the double qu
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.To describe some of the more obvious steps I have tried, lets store the initial variables like as following:{code:puppet}#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{code}The initial most logical combination of options that I have tried are (elaborated here to try and make it clearer clear ):*Attempt 1*Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes:{code:puppet}# Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", '"', '\\"', 'G'augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code}Produces:{noformat}-log_format main '$remote_addr - $remote_user [$time_local] "$request" '- '$status $body_bytes_sent "$http_referer" '- '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}*Result:* Produces almost exactly what I want, but unfortunately the escapes have been passed through and retained. (I feel like this The result is where confirmed when grep'ing the real bug lies file:{noformat}root@dcscache-lon2 ~]# grep log_format /etc/nginx/nginx . ) conflog_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat} Maybe I don't do not need the esca
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.To describe some of the more obvious steps I have tried, lets store the initial variables like as following:{code:puppet}#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{code}The initial most logical combination of options that I have tried are (elaborated here to try and make it clearer): * Attempt 1* Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes: * {code:puppet}# Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", '"', '\\"' ' , 'G' ) augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code}Produces:{noformat}-log_format main '$remote_addr - $remote_user [$time_local] "$request" '- '$status $body_bytes_sent "$http_referer" '- '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}*Result:* Produces almost exactly what I want, but unfortunately the escapes have been passed through and retained. (I feel like this is where the real bug lies.) Maybe I don't need the escapes? Let's try without... * Attempt 2* Don't escape the double quotes within the substring, but still pass the variable in augeas with escaped quotes: * {code:puppet}# Create the combined string$use_log_format = "${log_title} '${log_format_str}'"augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_f
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.To describe some of the more obvious steps I have tried, lets store the initial variables like as following:{code:puppet}#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{code}The initial most logical combination of options that I have tried are (elaborated here to try and make it clearer):*Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes:*{code:puppet}# Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", '"', '\\"'', 'G')augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code}Produces:{noformat}-log_format main '$remote_addr - $remote_user [$time_local] "$request" '- '$status $body_bytes_sent "$http_referer" '- '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat}*Result:* Produces almost exactly what I want, but unfortunately the escapes have been passed through and retained. (I feel like this is where the real bug lies.) Maybe I don't need the escapes? Let's try without...*Don't escape the double quotes within the substring, but still pass the variable in augeas with escaped quotes:*{code:puppet}# Create the combined string$use_log_format = "${log_title} '${log_format_str} ' "augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat}timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug. The most logical combination To describe some of options that the more obvious steps I have tried are (elaborated here to try and make it clearer) , lets store the initial variables like as following :{code: java puppet }#The log title:$log_title = 'timed_combined'#Set-up the needed log_format string:$log_format_str = '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe' {code} The initial most logical combination of options that I have tried are (elaborated here to try and make it clearer):*Escape the double quotes within the substring, then pass the variable in augeas with escaped quotes:*{code:puppet} # Create the combined string$use_log_format = regsubst("${log_title} '${log_format_str}'", ' \ " ' ' , '\\ \ " '', 'G')augeas { 'set-up_log_format':context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]} {code} Describe steps to reproduce… Produces: {noformat} *Desired Behavior:* -log_format main '$remote_addr - $remote_user [$time_local] "$request" ' - '$status $body_bytes_sent "$http_referer" ' - '"$http_user_agent" "$http_x_forwarded_for"';+log_format timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_response_time $pipe';{noformat} * Actual Behavior Result :* Please take a moment Produces almost exactly what I want, but unfortunately the escapes have been passed through and attach any relevant log output and/or manifests retained . This will help us immensely when troubleshooting (I feel like this is where the issue real bug lies . ) Maybe I don't need the escapes? Let's try without... Example
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton updated an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Change By: Russell Knighton *Puppet Version: 5.4.0* *Puppet Server Version: 5.2.0* *OS Name/Version: CentOS 7.4.1708*I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible.The desired value I am trying to set exactly is:{noformat} timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe'{noformat}Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug.The most logical combination of options that I have tried are (elaborated here to try and make it clearer) : {code:java} # The log title:$log_title = 'timed_combined'# Set-up the needed log_format value string :$ use_log_format_tmp log_format_str = "timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \ "$request \ " $status $body_bytes_sent \ "$http_referer \ " \ "$http_user_agent \ " $request_time $upstream_response_time $pipe' # Create the combined string$use_log_format = regsubst( " ${log_title} '${log_format_str}'", '\'', '\\\'', 'G') augeas { 'set-up_log_format': context => "/files${conf_file}/http",changes => ["set log_format \"${use_log_format}\""]}{code} Describe steps to reproduce…*Desired Behavior:**Actual Behavior:*Please take a moment and attach any relevant log output and/or manifests. This will help us immensely when troubleshooting the issue.Examples: Run puppet agent with --test --trace --debugRelevant sections of {{/var/log/puppetlabs/puppetserver/puppetserver.log}} or any applicable logs from the same directory.For more detailed information turn up the server logs by upping the log level in the server's logback.xmlRelevant sections of configurations files (puppet.conf, hiera.conf, Server's conf.d, defaults/sysconfig)For memory issues with server heap dumps are also helpful.
Jira (PUP-8561) Augeas unable to handle escaped quotes within quotes
Title: Message Title Russell Knighton created an issue Puppet / PUP-8561 Augeas unable to handle escaped quotes within quotes Issue Type: Bug Assignee: Unassigned Created: 2018/03/20 7:48 AM Priority: Normal Reporter: Russell Knighton Puppet Version: 5.4.0 Puppet Server Version: 5.2.0 OS Name/Version: CentOS 7.4.1708 I am unable to find a way to set the "log_format" variable in nginx.conf using augeas. The problem seems to be the combination of quotes within quotes just doesn't seem to be possible. The desired value I am trying to set exactly is: timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe' Take careful note that I need to have the long single quoted string, but that this contains some double quoted strings. I have tried every possible combination I can think of for enclosing in single or double quoted strings in and for escaping then, but I have not successfully managed to set exactly what is required. I have tried so many different possible ways over the last 2 days that I am now convinced I haven't missed something and that this has to be a bug. The most logical combination of options that I have tried are: Set-up the log_format value: $use_log_format_tmp = "timed_combined '$remote_addr - $remote_user $http_x_unit_id [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" $request_time $upstream_resp