[augeas-devel] Is this a bug in Augeas?

David Lutterkort lutter at watzmann.net
Mon Jun 4 18:30:52 UTC 2018


Hi Rich,

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.

I've opened a PR (https://github.com/hercules-team/augeas/pull/562) 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.

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.

David

On Wed, May 30, 2018 at 5:50 AM, Richard W.M. Jones <rjones at redhat.com>
wrote:

>
> https://bugzilla.redhat.com/show_bug.cgi?id=1582236
>
> A customer reported that virt-v2v failed when presented with a
> grub.conf file which contained:
>
>   # grub.conf generated by anaconda
>   boot=/dev/sda1
>   acpi=off
>   default=0
>   timeout=5
>   [... etc ...]
>
> It failed at the line ‘acpi=off’.  This is not a grub command (I
> suspect the customer was asked to add this to the kernel command line,
> but added it in the wrong place), but it appears that grub ignores it.
> Augeas fails to parse the whole file.
>
> So Augeas is kind of doing the right thing here (pointing out an error
> in the configuration), but also being overly fussy, and IMHO it
> unnecessarily prevents a v2v conversion which should succeed.
>
> What's the best way to deal with this?  A catch-all rule in grub.lens?
> We want to edit this file so I think we need to try to preserve the
> incorrect line.
>
> Rich.
>
> --
> Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~
> rjones
> Read my programming and virtualization blog: http://rwmj.wordpress.com
> virt-p2v converts physical machines to virtual machines.  Boot with a
> live CD or over the network (PXE) and turn machines into KVM guests.
> http://libguestfs.org/virt-v2v
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20180604/86fb434e/attachment.htm>


More information about the augeas-devel mailing list