Issue #7529 has been updated by Dominic Cleal.

Randall Hansen wrote:
> Is this a feature of Augeas or a bug?  I'd hate to add another layer of 
> syntax to work around a resource bug.
> 
> If the former, then this seems like a relatively sane way to implement it.

Hard to call.. more like a design wart than a bug.  For some config files, 
string values have to be explicitly quoted while other values don't - Augeas 
can't tell which it should be, so this design has emerged.  I can't see the 
need going away, there's no trivial fix.

It's quite normal to need two levels of quoting, one for the value itself and 
the other as required by the provider which parses the commands.  The same 
occurs in augtool, the upstream CLI tool.  I don't see how we could redesign 
the provider to remove its need for one level of quotes - the resource 
specifications simply aren't flexible enough (probably a good thing).
----------------------------------------
Feature #7529: Support alternative quotes for string literals
https://projects.puppetlabs.com/issues/7529

Author: Dominic Cleal
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
Category: language
Target version: 
Affected Puppet version: 
Keywords: language quoting
Branch: 


Quoting can be an issue with Augeas resources, where strings in commands are 
quoted but the value itself has to contain quotes.  For example, to set the 
value of a node to "bar" (with the quotes), one might do:

    augeas { "myaug":
      changes => "set Foo[. = '\"$bar\"'] '\"$bar\"'"
    }

If the DSL supported some alternative method of quoting, such as [Perl's q{} 
and/or qq{}](http://perldoc.perl.org/perlop.html#Quote-Like-Operators) or 
[Ruby's %q and 
%Q](http://en.wikibooks.org/wiki/Ruby_Programming/Alternate_quotes), we could 
lose a level of escaping.

Perhaps the above example could then be improved to read:

    augeas { "myaug":
      changes => %Q(set Foo[. = '"$bar"'] '"$bar"')
    }


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