Fix load paths for nova base provider

This adds the $LOAD_PATH manipulation needed to find openstacklib from
the nova base provider code.  When compiling a static catalog (puppet
master --compile), the puppet master doesn't populate the plugin
directory before hand.  That means that either openstacklib won't be
found at all, or may be an old mismatched version.  This code is copied
from the keystone module which has similar needs.

Change-Id: I60f9389a571362191180442ffbad9a92bd9c0c78
This commit is contained in:
Clayton O'Neill
2016-09-28 01:56:00 +00:00
parent e42e6d25bc
commit c1b27658ea

View File

@@ -1,5 +1,9 @@
# Run test ie with: rspec spec/unit/provider/nova_spec.rb
# Add openstacklib code to $LOAD_PATH so that we can load this during
# standalone compiles without error.
File.expand_path('../../../../openstacklib/lib', File.dirname(__FILE__)).tap { |dir| $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir) }
require 'puppet/util/inifile'
require 'puppet/provider/openstack'
require 'puppet/provider/openstack/auth'