Hi Trevor, 

1) there is an issue open at 
https://github.com/hercules-team/augeasproviders/issues/67. I've been thinking 
about how to fix this and have come up with a few ideas. Currently, a new 
Augeas handler is spawned for every call to augopen, which means the file is 
opened for exists?, create, destroy, and for each property getter or setter. 
That explains the huge amount of file openings (and possibly writings, too) you 
can get with these providers. Solutions include:

- using one augeas handler per resource, reusing it for all methods, and 
possibly using flush to save. This is probably a good idea anyway as it will 
avoid applying some properties when others may fail. 
- using one augeas handler for all resources. While this would drastically 
reduce the amount of times files are opened, it is most likely a bad idea as 
this means a single resource breaking the Augeas tree will cause all resources 
to fail saving. 
- "prefetching" all resources from a given target file when a resource first 
requests it. I'm not really sure how that would be implemented, but it would at 
least reduce the amount of file reading. Coupling this with a flush method per 
resource would lead to a nice solution imo.

2) Augeas providers already report when files fail to parse. The Augeas tree 
clearly indicates which line and character failed to parse, so this can easily 
be improved. 

3) that is a tricky one. As you said, it mostly depends on the lens itself. 
Some lenses are very strict (with all known parameters  explicitly listed) 
while others are quite loose. It is often up to the lens authors to decide on 
their policy, but some formats also don't leave much of a choice (because of 
entry types, typically strings vs lists)

4) I suppose you're referring to mapping properties to the Augeas API?


All this said, while Augeas now has most of the lenses required to replace all 
parsedfile providers in the Puppet core, I would still be in favor of keeping 
some kind of parsedfile (or equivalent, such as Adrien's new implementation) 
mechanism in the core for cases that Augeas might have a hard time addressing 
(or devs that would rather not use it).

 
Cheers,

Raphaël Pinson

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/c386ea90-6628-4627-8950-26060bc9eedf%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to