Use a relative path load on LoadError

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
This commit is contained in:
Nate Riffe 2016-07-04 18:04:43 -05:00
parent 0cdd94cf86
commit a2c729c881
2 changed files with 14 additions and 2 deletions

View File

@ -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

View File

@ -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