Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Span indices not updated #467

Closed
bmw opened this issue May 16, 2017 · 1 comment
Closed

Span indices not updated #467

bmw opened this issue May 16, 2017 · 1 comment

Comments

@bmw
Copy link

bmw commented May 16, 2017

I created the same setup as I posted in #466 except commands is:

transform Httpd incl /home/bmw/default.conf
load
span /files/home/bmw/default.conf/VirtualHost[2]
set /files/home/bmw/default.conf/VirtualHost[2]/directive[last() + 1] foo
save
print /files/home/bmw/default.conf/VirtualHost[2]
span /files/home/bmw/default.conf/VirtualHost[2]

Running augtool -f commands -I augeas_lens/ -L --span from this directory you can see that the result of span isn't updated after the file is modified. I saw this behavior in both Augeas 1.4 and 1.7.

@lutter
Copy link
Member

lutter commented Sep 9, 2017

Yes, spans are only calculated when files are loaded. One simple way to avoid this issue is to force reloading of the file with something like

rm /files/home/bmw/default.conf
load

The rm is necessary since Augeas tries to avoid loading files it already has in memory that haven't changed since the last time it did anything with them. It won't modify the file, it just forces Augeas to load it.

I'll try and come up with a solution that recalculates span info on save though, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants