[augeas-devel] Saving changed tree to file does not work but no error message

Raphaël Pinson raphael.pinson at camptocamp.com
Mon Jan 4 08:44:50 UTC 2016


Hello Christoph and happy new year to you too!


Your code doesn't check for errors (either parsing or saving errors). You
could add checks (looking for `/augeas//error` nodes) just after your call
to aug_load (for parsing errors) and to aug_save (for saving errors).

One way to debug your code would also be to try it with augtool, which
would be easier to debug.

Also, are you aware of the netcf project, which provides a higher API on
top of Augeas to access and modify /etc/network/interfaces?



Cheers,

Raphaël





On Fri, Jan 1, 2016 at 5:05 PM, Christoph Molitor <
christoph.molitor at googlemail.com> wrote:

> Dear all,
>
> first of all a happy new year to everyone.
>
> I am trying to use the augeas C API to apply changes to the
> "/etc/network/interfaces" file.
> So far I was able to apply changes to the tree. However, I am not able to
> save the changes back to the file.
> First, I thought it is a problem with the permissions. However, I copied
> the interfaces file to a different folder and it still does not work.
> Using the command line tool augtool, I am able to make the changes and
> save them to the file.
>
> I uploaded an (almost) minimal version of my program to:
> https://github.com/cmolitor/AugeasDemoC
>
> The repository includes an example „interfaces“.
> I am working on a Raspberry Pi with Raspbian Jessie.
> It would be great if someone could give me a hint what I am doing work and
> where the problem might come from.
>
> Thanks for your support!
>
> Christoph
>
> _______________________________________________
> augeas-devel mailing list
> augeas-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/augeas-devel
>



-- 
Raphaël Pinson
Infrastructure Developer & Training Leader
+33 458 482 013

Camptocamp France
Savoie Technolac
BP 352
48, avenue du Lac du Bourget
73372 Le Bourget du Lac, Cedex
www.camptocamp.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20160104/db3dbdc4/attachment.htm>


More information about the augeas-devel mailing list