Files
puppet-nova/spec/spec_helper.rb
Denis Egorenko 08ee5866a6 Use OpenstackClient for nova providers auth
This patch changes the nova providers to use puppet-openstacklib's
authentication methods, which use python-openstackclient as an interface,
instead of the nova command line client.

The benefits of this is a code reduction. This patch reduces the amount
of code in the nova parent provider and nova providers by reusing code from
Puppet::Provider::Openstack instead of implementing authentication,
retries, and response parsing in the provider.

This patch doesn't affect next providers:

 * nova_network and nova_floating:
   openstack client has small functionality for managing nova floatings
   and doesn't provide possibility to manage nova-networks,
   so keeping old format of auth for this providers.
   Also Nova-Network is deprecated.
 * nova_cell:
   openstack client doesn't provide possibility to manage cells;
 * nova security groups - will be done in separate patch;

Additional reasoning for this change is in the blueprint.

Also added new tests for providers.

blueprint use-openstackclient-in-module-resources

Change-Id: Ifa09aeb71ba0bcc425eece314803a0d1609bed9f
2016-03-22 18:42:40 +03:00

21 lines
779 B
Ruby

# Load libraries from openstacklib here to simulate how they live together in a real puppet run (for provider unit tests)
$LOAD_PATH.push(File.join(File.dirname(__FILE__), 'fixtures', 'modules', 'openstacklib', 'lib'))
require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
require 'puppet-openstack_spec_helper/defaults'
require 'rspec-puppet-facts'
include RspecPuppetFacts
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
# TODO(aschultz): remove this after all tests converted to use OSDefaults
# instead of referencing @default_facts
c.before :each do
@default_facts = OSDefaults.get_facts
end
end
at_exit { RSpec::Puppet::Coverage.report! }