<div dir="ltr"><div><div>Hi Rich,<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 3, 2016 at 7:27 AM, Richard W.M. Jones <span dir="ltr"><<a href="mailto:rjones@redhat.com" target="_blank">rjones@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">However if the Augeas lens happens to contain that path already,<br>
things go wrong:<br>
<br>
  augtool> transform passwd incl /etc/passwd<br>
  augtool> load<br>
  # /etc/passwd is not parsed by the passwd lens<br>
  augtool> get /augeas/files/etc/passwd/<wbr>error/message<br>
  /augeas/files/etc/passwd/<wbr>error/message = Lenses @Passwd and passwd.lns could be used to load this file<br>
<br>
This is specifically a problem when libguestfs adds a call to<br>
aug_transform to cater for a file that is not covered by an existing<br>
lens, but then Augeas adds that file, and then we get the error above<br>
until libguestfs removes the call to aug_transform.  We cannot control<br>
when Augeas and libguestfs are released in different Linux distros.<br></blockquote><div><br></div><div>That's a good point that I hadn't thought about before.<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

There are workarounds for this involving fishing out the existing<br>
transform and working out if it covers the file or not, but that's<br>
pretty tedious.<br>
<br>
It seems to be that Augeas could be cleverer here and could just<br>
ignore the case where two identical transforms apply to the same file<br>
and DWIM.<br></blockquote><div><br>I just put up a PR[1] that makes it ok for multiple transforms to handle the same file as long as they use the same lens. I'll wait with making the release that I was going to make today until I hear back from you - could you make sure you run this patch through whatever Augeas-relevant tests you have in libguestfs ? I want to make sure I don't have some unintentional screwup in there that might break loading or saving where it used to work. (and hearing back some time next week is  early enough; there's nothing requiring a release be made right now)<br><br>David<br><br>[1] <a href="https://github.com/hercules-team/augeas/pull/425">https://github.com/hercules-team/augeas/pull/425</a><br><br></div></div></div></div>