<div dir="ltr"><div>Hi Rich,</div><div><br></div><div>I'll leave it to the philosophers whether this is a bug or something else - Augeas' behavior there is certainly not very helpful. The behavior is a combination of Augeas general refusal to deal with things it doesn't understand (sound, but not very helpful) and the fact that the Grub lens is very specific about what constitutes acceptable input. In a lens that was written to be more lenient, this would probably not bea problem.<br></div><div><br></div><div>I've opened a PR (<a href="https://github.com/hercules-team/augeas/pull/562">https://github.com/hercules-team/augeas/pull/562</a>) with a modified Grub lens that is more tolerant of these kinds of errors. Lines like the 'acpi=off' in your example will now be mapped into the tree as '#error' nodes, rather than refusing to parse such a file outright. Let me know if that does what you need it to do, or if it needs to be changed further.</div><div><br></div><div>The approach I took (manually writing 'error' lenses) might lead to a bit of whack-a-mole. It would be nice to have a more general approach for dealing with malformed input, but that would be a more serious undertaking and require quite a bit of surgery in the Augeas internals.</div><div><br></div><div>David<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 30, 2018 at 5:50 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<a href="https://bugzilla.redhat.com/show_bug.cgi?id=1582236" rel="noreferrer" target="_blank">https://bugzilla.redhat.com/<wbr>show_bug.cgi?id=1582236</a><br>
<br>
A customer reported that virt-v2v failed when presented with a<br>
grub.conf file which contained:<br>
<br>
  # grub.conf generated by anaconda<br>
  boot=/dev/sda1<br>
  acpi=off<br>
  default=0<br>
  timeout=5<br>
  [... etc ...]<br>
<br>
It failed at the line ‘acpi=off’.  This is not a grub command (I<br>
suspect the customer was asked to add this to the kernel command line,<br>
but added it in the wrong place), but it appears that grub ignores it.<br>
Augeas fails to parse the whole file.<br>
<br>
So Augeas is kind of doing the right thing here (pointing out an error<br>
in the configuration), but also being overly fussy, and IMHO it<br>
unnecessarily prevents a v2v conversion which should succeed.<br>
<br>
What's the best way to deal with this?  A catch-all rule in grub.lens?<br>
We want to edit this file so I think we need to try to preserve the<br>
incorrect line.<br>
<br>
Rich.<br>
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Richard Jones, Virtualization Group, Red Hat <a href="http://people.redhat.com/~rjones" rel="noreferrer" target="_blank">http://people.redhat.com/~<wbr>rjones</a><br>
Read my programming and virtualization blog: <a href="http://rwmj.wordpress.com" rel="noreferrer" target="_blank">http://rwmj.wordpress.com</a><br>
virt-p2v converts physical machines to virtual machines.  Boot with a<br>
live CD or over the network (PXE) and turn machines into KVM guests.<br>
<a href="http://libguestfs.org/virt-v2v" rel="noreferrer" target="_blank">http://libguestfs.org/virt-v2v</a><br>
<br>
______________________________<wbr>_________________<br>
augeas-devel mailing list<br>
<a href="mailto:augeas-devel@redhat.com">augeas-devel@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/augeas-devel" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/augeas-devel</a></font></span></blockquote></div><br></div>