Add lib directories to $LOAD_PATH if not present

A combination of issues with puppet and rspec-puppet make it impossible
for rspec-puppet to properly load puppet/util/openstack when other
modules run tests against puppet-keystone. This patch works around the
issue by adding all directories in lib/puppet to the $LOAD_PATH prior
to attempting to use them.

Change-Id: I1137459c18e8645e4e8d3b8abb5f93d8b8dbab13
Closes-bug: 1408531
This commit is contained in:
Colleen Murphy 2015-01-07 19:02:57 -08:00
parent 0696d02d8b
commit 031300546a
6 changed files with 12 additions and 0 deletions

View File

@ -1,3 +1,5 @@
# LP#1408531
File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
require 'puppet/util/openstack'
Puppet::Type.newtype(:keystone_endpoint) do

View File

@ -1,3 +1,5 @@
# LP#1408531
File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
require 'puppet/util/openstack'
Puppet::Type.newtype(:keystone_role) do

View File

@ -1,3 +1,5 @@
# LP#1408531
File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
require 'puppet/util/openstack'
Puppet::Type.newtype(:keystone_service) do

View File

@ -1,3 +1,5 @@
# LP#1408531
File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
require 'puppet/util/openstack'
Puppet::Type.newtype(:keystone_tenant) do

View File

@ -1,3 +1,5 @@
# LP#1408531
File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
require 'puppet/util/openstack'
Puppet::Type.newtype(:keystone_user) do

View File

@ -1,3 +1,5 @@
# LP#1408531
File.expand_path('../..', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
require 'puppet/util/openstack'
Puppet::Type.newtype(:keystone_user_role) do