[augeas-devel] Problem with function save of python binding for augeas (need to save twice)

Louis Coilliot louis.coilliot at wazemmes.org
Sun Nov 2 21:41:39 UTC 2008


Hello,

This fails:

#!/usr/bin/python
from augeas import augeas
auginstance=augeas()
auginstance.set('/files/etc/ssh/sshd_config/PermitRootLogin','no')
auginstance.save()

Output:
Traceback (most recent call last):
  File "./test.py", line 10, in ?
    auginstance.save()
  File "/usr/lib/python2.4/site-packages/augeas.py", line 266, in save
    raise IOError, "Unable to save to file!"
IOError: Unable to save to file!


But there's more. This works:

from augeas import augeas
auginstance=augeas()
auginstance.set('/files/etc/ssh/sshd_config/PermitRootLogin','no')
try:
    auginstance.save()
except:
    pass
auginstance.save()

I need to save twice. Always.

When it succeeds, the change is saved.

Any idea ?


Louis Coilliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20081102/a8da80dc/attachment.htm>


More information about the augeas-devel mailing list