-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
Workaround libaugeas save/load issue #49
Workaround libaugeas save/load issue #49
Conversation
Should resolve the test issues in voxpupuli/puppet-augeasproviders_sysctl#65 |
# https://github.com/hercules-team/augeas/commit/eb04250a05671b2d001444b72b8778328d209d75 introduced a bug in libaugeas.so.0.25.0 | ||
# bundled with puppet7. | ||
# A temporary fix is to invoke load! twice. | ||
aug.load! if reload && Puppet::Util::Package.versioncmp(Puppet.version, '7.0.0') >= 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This depends on the Augeas version, not Puppet. So I'd prefer to use aug_version
instead. So something like:
aug.load! if reload && Puppet::Util::Package.versioncmp(Puppet.version, '7.0.0') >= 0 | |
aug.load! if reload && Puppet::Util::Package.versioncmp(aug_version, '1.13.0') >= 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I tried this but then my test broke ....
puts "Puppet version: #{Puppet.version}, Augeas version: #{aug_version}"
says
Puppet version: 6.29.0, Augeas version: 1.12.0
Puppet version: 7.24.0, Augeas version: 1.12.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that's weird. On my Fedora with system Ruby:
$ pry
[1] pry(main)> require 'augeas'
=> true
[2] pry(main)> Augeas.open(nil, nil, Augeas::NO_MODL_AUTOLOAD) { |aug| aug.get('/augeas/version') }
=> "1.13.0"
On my EL8 AIO:
$ rpm -qv puppet-agent
puppet-agent-7.24.0-1.el8.x86_64
$ /opt/puppetlabs/puppet/bin/ruby
require 'augeas'
puts Augeas.open(nil, nil, Augeas::NO_MODL_AUTOLOAD) { |aug| aug.get('/augeas/version') }
1.13.0
On a Debian 11 machine with puppet-agent-7.24.0-1bullseye
:
# /opt/puppetlabs/puppet/bin/ruby
require 'augeas'
puts Augeas.open(nil, nil, Augeas::NO_MODL_AUTOLOAD) { |aug| aug.get('/augeas/version') }
1.13.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, unit tests does not use puppet agent, and on my rockylinux-8 vagrant box augeas-lib 1.12.0 is installed.
Should I just drop the unit test I added then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured out how to stub it :)
And it would also be good to verify if hercules-team/augeas#810 solves it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Verified on
verification script
Test with manual build of the release-1.13.0 tag
Test with manual build of fix_691_modified branch
|
Pull Request (PR) description
hercules-team/augeas#691 introduced a bug in libaugeas bundled with puppet 7.
The bug manifests it self in this modules augsave! method when invoked with reload=true.
A workaround is to invoke aug.load! twice after an aug.save!
See voxpupuli/puppet-augeasproviders_sysctl#65