[augeas-devel] set for multiple entries?
David Lutterkort
lutter at redhat.com
Thu Feb 25 23:43:09 UTC 2010
On Thu, 2010-02-25 at 19:19 +0100, Frederik Wagner wrote:
> Hi .*,
>
> I would like to append definitions for the console to _all_ kernel
> lines ins the grub configuration. Is there a way to do that without
> knowing howmany entries there are? E.g. using something like:
>
> augtool> set /files/boot/grub/menu.lst/title[*]/kernel/console[1] ttyS0
> or
> augtool> set /files/boot/grub/menu.lst/*/kernel/console[1] ttyS1
>
> I.e. so every title entry containing a kernel line would get
> "console=..." parameters appended.
> It is not working like I wrote, but there hopefully is away (btw. I'm
> using augeas normally through puppet!).
There's actually no way to do that through the API in one call - you can
do it, e.g. in Ruby with something like
aug.match("/files/boot/grub/menu.lst/*/kernel/console").each do
|p|
aug.set(p, "ttyS1")
end
It would not be very hard to add a aug_set_all call to the API (it would
be a slight variation on aug_set in augeas.c) If you feel up to it, I'd
happily take a patch ;)
David
More information about the augeas-devel
mailing list