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
_______________________________________________
augeas-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/augeas-devel

Reply via email to