<div class="gmail_quote">On Wed, Aug 1, 2012 at 5:06 PM, Pat Riehecky <span dir="ltr"><<a href="mailto:riehecky@fnal.gov" target="_blank">riehecky@fnal.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 08/01/2012 09:22 AM, Raphaël Pinson wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Pat,<br>
<br>
Sorry for the long delay in replying to you.<br>
</blockquote>
<br></div>
No worries, I've been busy too!<div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
On Thu, Apr 19, 2012 at 11:47 PM, Pat Riehecky <<a href="mailto:riehecky@fnal.gov" target="_blank">riehecky@fnal.gov</a> <mailto:<a href="mailto:riehecky@fnal.gov" target="_blank">riehecky@fnal.gov</a>>> wrote:<br>

<br>
<br>
    (Apologies for the return of this old thread, but the history<br>
    seemed to help provide context)<br>
<br>
    I've almost got this working the way I think it should and reading<br>
    my site's krb5.conf.  The only remaining issue I'm running into is<br>
    with 'default_tgs_enctypes'.  I'd love to get it into a sequence,<br>
    but I can't seem to figure out how.  The attached patch gets me<br>
    really close, where I've got a sequence called 'type' under<br>
    default_tgs_enctypes, but the extra part of the tree seems to be<br>
    extra rather than useful, plus it seems to make setting those<br>
    things a bit messy when it wasn't before - Was<br>
    /files/etc/krb5.conf/<u></u>libdefaults/default_tgs_<u></u>enctypes = 'thing' my<br>
    changes make<br>
    /files/etc/krb5.conf/<u></u>libdefaults/default_tgs_<u></u>enctypes/type[x] =<br>
    'thing' which is not right.....<br>
<br>
<br>
<br>
The patch you attached leads to an ambiguity:<br>
<br>
$ augparse -I . krb5.aug<br>
Syntax error in lens definition<br>
krb5.aug:49.0-53.87:Failed to compile libdefaults<br>
krb5.aug:47.26-.71:exception: ambiguous iteration<br>
      Iterated regexp: /([a-zA-Z0-9]+-[a-zA-Z0-9]+-[<u></u>a-zA-Z0-9]+)([ \t,]*)/<br>
      'A-A-AAA-A-A' can be split into<br>
      'A-A-A|=|AA-A-A'<br>
<br>
     and<br>
      'A-A-AA|=|A-A-A'<br>
<br>
    Iterated lens: krb5.aug:47.26-.70:<br>
<br>
</blockquote></div></div>
Hmmm, this is quite the puzzle.<br>
<br>
When one value is specified ('A-A-A') it is followed by a new line, read terminates, no problem.  When multiples are set they are delimited by spaces, tabs, commas, or a combination of all three.  However, the one at the end may or may not have a trailing delimiter.  So I'm not sure I can enforce delimiters to separate the items.<br>

<br>
Currently the third item ('A-A-B', the B) seems to be limited to 3 or 4 characters with a minimum of 3, but it appears that a smaller one is possible.  Grumble....  All of these appear to be valid entries: rc4-hmac arcfour-hmac arcfour-hmac-md5 aes128-cts des3-cbc-sha1 rc4-hmac des-cbc-md5 des-cbc-crc<br>

<br>
Can augeas do word boundaries?  Most of my regex is perl style rather than POSIX  That should solve the ambiguity but my googling is only turning up perl style....<div class="im"><br></div></blockquote><div><br><br>I think what you want is Build.opt_list (see all lenses using it, there's many):<br>
<br>Build.opt_list enctype_re valsep<br><br><br>See lenses/build.aug for the doc.<br><br> <br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
    If I may ask three questions:<br>
<br>
    So what can I do to get the sequence to populate when there are<br>
    multiple items, but not when there are not?<br>
    And how do I use the regex match for the sequence name?<br>
    Is my attempt at a fix even on the right track?<br>
<br>
<br>
<br>
If you mean to generate an array only where there is more than one element, and use a fix value otherwise, dynamically, then it's a rather bad idea, since it will make it hard to add a second value to an existing unique one.<br>

<br>
However, if supporting arrays vs single values is linked to specific keys, they you could explicitely split the cases to have a lens for array entries and another lens for simple entries. This is already done in quite a few modules.<br>

<br>
</blockquote></div>
I'll look more closely into the second option here.  May I request a module to pattern my code after?<br>
<br></blockquote><div><br><br>Sure, see sshd.aug which uses array_entry and other_entry for example, or logrotate.aug which has select_to_eol, value_to_eol, list_to_eol and flag_to_eol entries.<br><br></div></div><br clear="all">
<br>-- <br>Raphaël Pinson<br>Administrateur Systèmes & Réseaux<br>
Camptocamp France<br>
Savoie Technolac<br>
BP 352<br>
48, avenue du Lac du Bourget<br>
73372 Le Bourget du Lac, Cedex<br>
<a href="http://www.camptocamp.com" target="_blank">www.camptocamp.com</a><br>
<br>