[augeas-devel] Newbie to augeas: Questions about perl interface

Peter Valdemar Mørch peter at morch.com
Sat Feb 4 21:41:02 UTC 2012


Hello Raphaël,

On Fri, Feb 3, 2012 at 6:31 PM, Raphaël Pinson <raphink at gmail.com> wrote:
> I inherited Config::Augeas recently from Dominique Dumont, who
> originally developed it for his Config::Model package.
> This is a part I haven't yet modified, but I see what you mean.
>
> Would it be easier for you if this function actually returned 0 and
> let you do an $aug->get("/augeas//error") yourself to find the
> problem?

Yup. I sent you a pull request for that (and two other commits). My
branch is based off of version 0.710 because I'm on debian squeeze,
but it merges cleanly with master.

> Just like the aug_set C function, $aug->set() takes a single value as
> argument, so you need to pass the values one by one.
> That said, you're welcome to propose a patch to pass a hashref if
> that's useful to you (that would make it closer to the behavior of the
> Augeas puppet module, using context and changes).

I must admit I'm too much of a newbie to Augeas to propose anything
sensible and consistent. Perhaps later. I'm fine with it as it is. I
was just suprised.

> $aug->error() and $aug->error_message() only return the API error
> codes and messages (as returned by the C library). The actual set
> error can be found by running $aug->get("/augeas//error") as Augeas
> keeps all its errors in the /augeas tree.

I see. From my tiny experience, that seems consistent with augtool.

Thank you for a quick response,

Peter
-- 
Peter Valdemar Mørch
http://www.morch.com




More information about the augeas-devel mailing list