[augeas-devel] [Augeas] #184: Lens union not considered in put direction

Augeas trac at fedorahosted.org
Mon Feb 28 20:36:22 UTC 2011


#184: Lens union not considered in put direction
------------------------+---------------------------------------------------
 Reporter:  raphink     |       Owner:  lutter
     Type:  defect      |      Status:  new   
 Priority:  critical    |   Milestone:  next  
Component:  Augeas      |     Version:  devel 
 Keywords:  put, union  |  
------------------------+---------------------------------------------------
 This is a bug I have first encountered when working on aptconf.aug, and I
 thought it was related to recursive lenses. But I found that it appears
 also in dhclient.aug, which is not a recursive lens.

 Here is how to reproduce in 0.8.0:

 {{{
 $ grep '^option' fakeroot/etc/dhcp3/dhclient.conf
 option rfc3442-classless-static-routes code 121 = array of unsigned
 integer 8;
 $ augtool -r fakeroot
 augtool> print /files/etc/dhcp3/dhclient.conf/option/
 /files/etc/dhcp3/dhclient.conf/option
 /files/etc/dhcp3/dhclient.conf/option/rfc3442-classless-static-routes
 /files/etc/dhcp3/dhclient.conf/option/rfc3442-classless-static-routes/code
 = "121"
 /files/etc/dhcp3/dhclient.conf/option/rfc3442-classless-static-
 routes/value = "array of unsigned integer 8"
 augtool> set /files/etc/dhcp3/dhclient.conf/option/rfc3442-classless-
 static-routes/code 123
 augtool> save
 Saving failed
 augtool> print /augeas//error
 /augeas/files/etc/dhcp3/dhclient.conf/error = "put_failed"
 /augeas/files/etc/dhcp3/dhclient.conf/error/path =
 "/files/etc/dhcp3/dhclient.conf/option"
 /augeas/files/etc/dhcp3/dhclient.conf/error/lens =
 "/usr/share/augeas/lenses/dist/dhclient.aug:95.26-99.40:"
 /augeas/files/etc/dhcp3/dhclient.conf/error/message = "Failed to match \n
 { /[.0-9A-Z_a-z-]+(\\\\[[0-9]+\\\\])?/ = /([^\\001-\\004\\t\\n
 \\\"#,;\\\\{}]+|\\\"[^\\001-\\004\\n\\\"#\\\\]+\\\")/ }({ /#comment/ =
 /[^\\001-\\004\\t\\n ][^\\001-\\004\\n]*[^\\001-\\004\\t\\n
 ]|[^\\001-\\004\\t\\n ]/ } | ())\n  with tree\n    { \"rfc3442-classless-
 static-routes\" }"
 }}}

 As it turns out, {{{(sto_to_spc|rfc_code)}}} on line 97 is never
 considered in the put direction. Removing the {{{sto_to_spc|}}} part makes
 the put work, but then the lens is not complete so the get test fails.

 The following test can be added to test_dhclient.aug to check the
 functionality:

 {{{
     test Dhclient.lns put "\n" after
        set "/option/rfc3442-classless-static-routes/code" "121" ;
        set "/option/rfc3442-classless-static-routes/value" "array of
 unsigned integer 8" =
        ?
 }}}

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/184>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list