Skip to content

Commit

Permalink
Use a relative path load on LoadError
Browse files Browse the repository at this point in the history
Some versions of Puppet suffer from a regression which prevents them from
successfully loading auxilliary code in the module's lib directory. See
https://tickets.puppetlabs.com/browse/SERVER-973
  • Loading branch information
inkblot committed Jul 4, 2016
1 parent 0cdd94c commit a2c729c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lib/puppet/provider/dns_rr/nsupdate.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
require 'puppet_bind/provider/nsupdate'
begin
require 'puppet_bind/provider/nsupdate'
rescue LoadError => e
# work around for puppet bug SERVER-973
Puppet.info('Puppet did not autoload from the lib directory... falling back to relative path load.')
require File.join(File.expand_path(File.join(__FILE__, '../../../..')), 'puppet_bind/provider/nsupdate')
end

Puppet::Type.type(:dns_rr).provide(:nsupdate) do

Expand Down
8 changes: 7 additions & 1 deletion lib/puppet/provider/resource_record/nsupdate.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
require 'puppet_bind/provider/nsupdate'
begin
require 'puppet_bind/provider/nsupdate'
rescue LoadError => e
# work around for puppet bug SERVER-973
Puppet.info('Puppet did not autoload from the lib directory... falling back to relative path load.')
require File.join(File.expand_path(File.join(__FILE__, '../../../..')), 'puppet_bind/provider/nsupdate')
end

Puppet::Type.type(:resource_record).provide(:nsupdate) do

Expand Down

0 comments on commit a2c729c

Please sign in to comment.