]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Use File.expand_path with require.
authorDaniele Sluijters <github@daenney.net>
Sun, 16 Mar 2014 11:44:05 +0000 (12:44 +0100)
committerDaniele Sluijters <github@daenney.net>
Sun, 16 Mar 2014 11:51:33 +0000 (12:51 +0100)
For some reason, even though our own tests pass with `require
puppet_x/apt_key/patch_openuri` every other module that depends on
puppetlabs-apt is now breaking in tests claiming it can't load that
module.

Somewhere along the way something is probably messing with LOADPATH
causing this to trip up. This should fix the issues for everyone.

This commit affects:
 * puppetlabs/puppetlabs-apt#229
 * puppetlabs/puppetlabs-postgresql#391

lib/puppet/provider/apt_key/apt_key.rb

index 51791d024811444e18cde8abab1efc79b3904beb..f8d40728b04a13727d32f1ede6cd2eebe4eb52ac 100644 (file)
@@ -6,7 +6,8 @@ require 'tempfile'
 if RUBY_VERSION == '1.8.7'
   # Mothers cry, puppies die and Ruby 1.8.7's open-uri needs to be
   # monkeypatched to support passing in :ftp_passive_mode.
-  require 'puppet_x/apt_key/patch_openuri'
+  require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', '..',
+                                    'puppet_x', 'apt_key', 'patch_openuri.rb'))
   OpenURI::Options.merge!({:ftp_active_mode => false,})
 end