<div dir="ltr">2014-02-22 9:44 GMT+01:00 Raphaël Pinson <<a href="mailto:raphael.pinson@camptocamp.com">raphael.pinson@camptocamp.com</a>>:<br><br>[Comments only start with ";"]<br>> 1) is just a setting, like:<br>
><br>>     let comment = IniFile.comment ";" ";"<br><br>Indeed, I already got it working, even though I think I also had to remove # from:<br><br><font face="courier new, monospace">let comment_re    = ";"<br>
let to_comment_re = /[^; \t\n][^;\n]*[^; \t\n]|[^; \t\n]/</font><br><br>[Entries can contain "@"]<br>> 2) shouldn't be a limitation at all.<br><br>Uhm, AFAIR parsing stopped there, until I added "@" to the entry regex:<br>
<br><font face="courier new, monospace">let entry_re = ( /[A-Za-z][@#A-Za-z0-9\._-]+/ )</font><br><br>[Values can contain "#"]<br>> For 3), have a look at the PythonPaste module, which also allows for "#" in<br>
> values:<br><br>Thanks, I was looking at it after your suggestion, but AFAICT it allows "#" in values by also prohibiting inline comments, which I need instead...<br><br>Anyway, while looking at it I though I could try starting customizing from the Samba module samba.aug, and indeed it works now!<br>
I just changed settings for comments:<br><br><font face="courier new, monospace">let comment  = IniFile.comment ";" ";"<br>let sto_to_comment<br>             = Util.del_opt_ws " "<br>             . store /[^; \t\n][^;\n]*[^; \t\n]|[^; \t\n]/</font><br>
<br>Then added "@" for the entries:<br><br><font face="courier new, monospace">let entry_re = /[A-Za-z0-9_.-][@A-Za-z0-9 _.:-]*[A-Za-z0-9_.-]/</font><br><br>And that's all.<br><br>[Double quotes in values]<br>
> For 4), have a look at the Quote module (used in various lenses), which<br><br>Without any extra effort, double quotes seem to be interpreted fine when printing values with augtool.<br><br>Now, my problem was how could I insert them when applying changes through Puppet.<br>
This is the solution I found (<a href="https://groups.google.com/d/msg/puppet-users/tHMPdFiUM-U/3W9HESPhWYAJ">https://groups.google.com/d/msg/puppet-users/tHMPdFiUM-U/3W9HESPhWYAJ</a>):<br><br><font face="courier new, monospace">augeas { 'myconf':</font><div>
<font face="courier new, monospace">  context  => '/files/myfilepath',<br>  changes  => 'set target[. = "mysection"]/myparameter \'"my value"\'',</font></div><div><font face="courier new, monospace">}</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks for your suggestions!</font></div><div><font face="arial, helvetica, sans-serif">Marco</font></div><div>
<font face="courier new, monospace"><br></font></div></div>