aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGabriel Nagy <gabriel.nagy@puppet.com>2020-09-09 16:20:03 +0300
committerGitHub <noreply@github.com>2020-09-09 16:20:03 +0300
commitcc841d2bd7e003bf1492374550e1446a5080b15a (patch)
tree9ece0c496112da6826e135002fa181f4c0f15ef9 /lib
parente2512df5a3cf3113110f40a826970111097323bb (diff)
parent897ca7a86b9595761e1492a4ffa36bbdb751a15a (diff)
downloadpuppet-augeas_core-cc841d2bd7e003bf1492374550e1446a5080b15a.tar.gz
puppet-augeas_core-cc841d2bd7e003bf1492374550e1446a5080b15a.tar.bz2
Merge pull request #27 from luchihoratiu/MODULES-7397
(MODULES-7397) Load Augeas lenses from modules
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/augeas/augeas.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/puppet/provider/augeas/augeas.rb b/lib/puppet/provider/augeas/augeas.rb
index bfa3852..c8f9643 100644
--- a/lib/puppet/provider/augeas/augeas.rb
+++ b/lib/puppet/provider/augeas/augeas.rb
@@ -367,8 +367,18 @@ Puppet::Type.type(:augeas).provide(:augeas) do
load_path.flatten!
end
- if Puppet::FileSystem.exist?("#{Puppet[:libdir]}/augeas/lenses")
- load_path << "#{Puppet[:libdir]}/augeas/lenses"
+ if Puppet::Application.name == :agent
+ if Puppet::FileSystem.exist?("#{Puppet[:libdir]}/augeas/lenses")
+ load_path << "#{Puppet[:libdir]}/augeas/lenses"
+ end
+ else
+ env = Puppet.lookup(:current_environment)
+ env.each_plugin_directory do |dir|
+ lenses = File.join(dir, 'augeas', 'lenses')
+ if File.exist?(lenses)
+ load_path << lenses
+ end
+ end
end
load_path.join(':')