[augeas-devel] [Augeas] #259: No file reload with aug_save in NEWFILE mode then aug_load
Augeas
trac at fedorahosted.org
Thu Mar 1 22:58:58 UTC 2012
#259: No file reload with aug_save in NEWFILE mode then aug_load
-------------------------------+---------------------
Reporter: domcleal | Owner: lutter
Type: defect | Status: new
Priority: minor | Milestone: next
Component: Augeas | Version: 0.7.4
Keywords: aug_load aug_save | Blocked By:
Blocking: |
-------------------------------+---------------------
When the save mode is set to "newfile" (PATH.augnew), an aug_save followed
by aug_load should reset the tree back to the original state because any
changes would have been written to PATH.augnew rather than PATH itself.
The change in 0.7.4 to make reloading files more conservative affects this
as before, all files would have been reloaded after a save.
{{{
mkdir -p etc/ssh
echo "PermitRootLogin no" > etc/ssh/sshd_config
cat <<EOF | augtool -er .
set /augeas/save newfile
set /files/etc/ssh/sshd_config/PermitRootLogin yes
save
load
get /files/etc/ssh/sshd_config/PermitRootLogin
EOF
}}}
The last "get" should be printing out "no", not "yes". The
etc/ssh/sshd_config file contains "no", but both the tree and
etc/ssh/sshd_config.augnew contain "yes".
This in particular affected a fix for Puppet's #11988 bug where we tried
to do:
1. set /augeas/save newfile
1. [ changes ]
1. save
1. set /augeas/save overwrite
1. load
1. [ changes ]
1. save
The resulting file doesn't contain the changes, as the tree wasn't reset
during the aug_load.
--
Ticket URL: <https://fedorahosted.org/augeas/ticket/259>
Augeas <http://augeas.net/>
a configuration API
More information about the augeas-devel
mailing list