[augeas-devel] Re: [Augeas] #4: Put of lenses with '?' is incorrect

Augeas trac at fedorahosted.org
Wed Aug 27 22:09:19 UTC 2008


#4: Put of lenses with '?' is incorrect
---------------------+------------------------------------------------------
  Reporter:  lutter  |       Owner:  lutter
      Type:  defect  |      Status:  new   
  Priority:  major   |   Milestone:  next  
 Component:  Augeas  |     Version:  devel 
Resolution:          |    Keywords:        
---------------------+------------------------------------------------------
Comment (by lutter):

 From the [[https://www.redhat.com/archives/augeas-
 devel/2008-August/msg00305.html mailing list]]:

   For a lens '(store /[a-z]+/)?' Augeas doesn't really know whether it
   should use the store lens or not - the way put is implemented, it really
   needs to reject that construct.

   In the example you had, what happens is that for a line like '# \n',
   Augeas parses that skipping the store, since there is nothing to store,
   and the resulting comment node has a NULL value associated with it. When
   you try to put the tree, Augeas gets confused and tries to do a store on
   the tree node with the NULL value, and then complains because you can't
   do a store of NULL.

   To fix this, there are two things to do: (1) add the missing typecheck
   for the '?' operator so that typechecking actually checks the current
   behavior (2) make the tree -> file transformation much smarter so that
   it takes the value of nodes into account and so that '(store /[a-z]+/)?'
   becomes legal.

-- 
Ticket URL: <https://fedorahosted.org/augeas/ticket/4#comment:2>
Augeas <http://augeas.net/>
a configuration API




More information about the augeas-devel mailing list