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

Raphaël Pinson raphink at gmail.com
Sun Feb 5 19:37:55 UTC 2012


On Sat, Feb 4, 2012 at 10:41 PM, Peter Valdemar Mørch <peter at morch.com> wrote:
> 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.


I saw that, thank you.

I actually also updated Build.PL to depend on libxml2 and Augeas
0.10.0, since Augeas now depends on libxml2 (I still have to code the
dump-xml function in Config::Augeas by the way).


>> 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.

Yes, this is the way it works in augtool indeed.


> Thank you for a quick response,

Thank your for a quick patch :-)


Raphaël




More information about the augeas-devel mailing list