diff options
author | Gabriel Nagy <gabriel.nagy@puppet.com> | 2021-02-22 19:00:25 +0200 |
---|---|---|
committer | Gabriel Nagy <gabriel.nagy@puppet.com> | 2021-02-22 19:08:35 +0200 |
commit | 44be62fc43407528d5873cdee1559c55a373257b (patch) | |
tree | 010e0198e5fa38a6f888b45cb842d879094ada3d /lib/puppet | |
parent | 209b03b13f67a76e53048c5f854af7d0bd0a6a87 (diff) | |
download | puppet-augeas_core-44be62fc43407528d5873cdee1559c55a373257b.tar.gz puppet-augeas_core-44be62fc43407528d5873cdee1559c55a373257b.tar.bz2 |
(MODULES-10950) Infer application name from run mode
Fix a regression introduced by MODULES-7397[1] which incorrectly assumed
that the application name can be queried through
`Puppet::Application.name`, causing lenses that are pluginsynced not to
be loaded.
Since we only need to find out whether or not we're running as part of
`puppet agent`, it should be enough to use `Puppet.run_mode.name`, which
returns `:agent` in this case, and `:user` otherwise.
[1] https://github.com/puppetlabs/puppetlabs-augeas_core/pull/27
Diffstat (limited to 'lib/puppet')
-rw-r--r-- | lib/puppet/provider/augeas/augeas.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb index c8f9643..b0a3e4f 100644 --- a/lib/puppet/provider/augeas/augeas.rb +++ b/lib/puppet/provider/augeas/augeas.rb @@ -367,7 +367,7 @@ Puppet::Type.type(:augeas).provide(:augeas) do load_path.flatten! end - if Puppet::Application.name == :agent + if Puppet.run_mode.name == :agent if Puppet::FileSystem.exist?("#{Puppet[:libdir]}/augeas/lenses") load_path << "#{Puppet[:libdir]}/augeas/lenses" end |