Fix neutron-bgp-dragent issues
Some typos and errors that I didn't catch while testing, I should have tested it better... Depends-On: https://review.openstack.org/#/c/583300/ Change-Id: Ic4fa94070dee1054fc456fcb5f062d487fdf8295
This commit is contained in:
parent
8ca79b574f
commit
9b02f45575
@ -1,6 +1,6 @@
|
|||||||
Puppet::Type.type(:neutron_bgp_dragent_config).provide(
|
Puppet::Type.type(:neutron_bgp_dragent_config).provide(
|
||||||
:openstackconfig,
|
:ini_setting,
|
||||||
:parent => Puppet::Type.type(:openstack_config).provider(:ruby)
|
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
|
||||||
) do
|
) do
|
||||||
|
|
||||||
def self.file_path
|
def self.file_path
|
@ -43,7 +43,7 @@
|
|||||||
#
|
#
|
||||||
# [*purge_config*]
|
# [*purge_config*]
|
||||||
# (Optional) Whether to set only the specified config options in the BGP dragent config.
|
# (Optional) Whether to set only the specified config options in the BGP dragent config.
|
||||||
# Defaults to false.
|
# Defaults to false
|
||||||
#
|
#
|
||||||
class neutron::agents::bgp_dragent(
|
class neutron::agents::bgp_dragent(
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
@ -62,8 +62,8 @@ class neutron::agents::bgp_dragent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
neutron_bgp_dragent_config {
|
neutron_bgp_dragent_config {
|
||||||
'BGP/bgp_speaker_driver': value => $bgp_speaker_driver;
|
'bgp/bgp_speaker_driver': value => $bgp_speaker_driver;
|
||||||
'BGP/bgp_router_id': value => $bgp_router_id;
|
'bgp/bgp_router_id': value => $bgp_router_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if $::neutron::params::dynamic_routing_package {
|
if $::neutron::params::dynamic_routing_package {
|
||||||
|
@ -77,8 +77,8 @@ class neutron::params {
|
|||||||
$l2gw_agent_package = 'openstack-neutron-l2gw-agent'
|
$l2gw_agent_package = 'openstack-neutron-l2gw-agent'
|
||||||
$l2gw_package = 'python2-networking-l2gw'
|
$l2gw_package = 'python2-networking-l2gw'
|
||||||
$ovn_metadata_agent_package = 'python-networking-ovn-metadata-agent'
|
$ovn_metadata_agent_package = 'python-networking-ovn-metadata-agent'
|
||||||
$dynamic_routing_package = 'openstack-neutron-dynamic-routing'
|
$dynamic_routing_package = false
|
||||||
$bgp_dragent_package = false
|
$bgp_dragent_package = 'openstack-neutron-bgp-dragent'
|
||||||
if $::operatingsystemrelease =~ /^7.*/ or $::operatingsystem == 'Fedora' {
|
if $::operatingsystemrelease =~ /^7.*/ or $::operatingsystem == 'Fedora' {
|
||||||
$openswan_package = 'libreswan'
|
$openswan_package = 'libreswan'
|
||||||
} else {
|
} else {
|
||||||
|
@ -40,8 +40,8 @@ describe 'neutron::agents::bgp_dragent' do
|
|||||||
|
|
||||||
it { should contain_resources('neutron_bgp_dragent_config').with_purge(default_params[:purge_config]) }
|
it { should contain_resources('neutron_bgp_dragent_config').with_purge(default_params[:purge_config]) }
|
||||||
|
|
||||||
it { should contain_neutron_bgp_dragent_config('BGP/bgp_speaker_driver').with_value(default_params[:bgp_speaker_driver]) }
|
it { should contain_neutron_bgp_dragent_config('bgp/bgp_speaker_driver').with_value(default_params[:bgp_speaker_driver]) }
|
||||||
it { should contain_neutron_bgp_dragent_config('BGP/bgp_router_id').with_value(facts[:ipaddress]) }
|
it { should contain_neutron_bgp_dragent_config('bgp/bgp_router_id').with_value(facts[:ipaddress]) }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with overridden params' do
|
context 'with overridden params' do
|
||||||
@ -52,21 +52,21 @@ describe 'neutron::agents::bgp_dragent' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_resources('neutron_bgp_dragent_config').with_purge(true) }
|
it { should contain_resources('neutron_bgp_dragent_config').with_purge(true) }
|
||||||
it { should contain_neutron_bgp_dragent_config('BGP/bgp_speaker_driver').with_value('FakeDriver') }
|
it { should contain_neutron_bgp_dragent_config('bgp/bgp_speaker_driver').with_value('FakeDriver') }
|
||||||
it { should contain_neutron_bgp_dragent_config('BGP/bgp_router_id').with_value('4.3.2.1') }
|
it { should contain_neutron_bgp_dragent_config('bgp/bgp_router_id').with_value('4.3.2.1') }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples 'neutron::agents::bgp_dragent on RedHat' do
|
shared_examples 'neutron::agents::bgp_dragent on RedHat' do
|
||||||
context 'with default params' do
|
context 'with default params' do
|
||||||
it { should contain_package('neutron-dynamic-routing').with(
|
it { should_not contain_package('neutron-dynamic-routing') }
|
||||||
|
|
||||||
|
it { should contain_package('neutron-bgp-dragent').with(
|
||||||
:ensure => default_params[:package_ensure],
|
:ensure => default_params[:package_ensure],
|
||||||
:name => platform_params[:dynamic_routing_package],
|
:name => platform_params[:bgp_dragent_package],
|
||||||
:tag => ['openstack', 'neutron-package'],
|
:tag => ['openstack', 'neutron-package'],
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { should_not contain_package('neutron-bgp-dragent') }
|
|
||||||
|
|
||||||
it { should contain_service('neutron-bgp-dragent').with(
|
it { should contain_service('neutron-bgp-dragent').with(
|
||||||
:ensure => 'running',
|
:ensure => 'running',
|
||||||
:name => platform_params[:bgp_dragent_service],
|
:name => platform_params[:bgp_dragent_service],
|
||||||
@ -81,14 +81,14 @@ describe 'neutron::agents::bgp_dragent' do
|
|||||||
:enabled => false )
|
:enabled => false )
|
||||||
end
|
end
|
||||||
|
|
||||||
it { should contain_package('neutron-dynamic-routing').with(
|
it { should_not contain_package('neutron-dynamic-routing') }
|
||||||
|
|
||||||
|
it { should contain_package('neutron-bgp-dragent').with(
|
||||||
:ensure => 'absent',
|
:ensure => 'absent',
|
||||||
:name => platform_params[:dynamic_routing_package],
|
:name => platform_params[:bgp_dragent_package],
|
||||||
:tag => ['openstack', 'neutron-package'],
|
:tag => ['openstack', 'neutron-package'],
|
||||||
)}
|
)}
|
||||||
|
|
||||||
it { should_not contain_package('neutron-bgp-dragent') }
|
|
||||||
|
|
||||||
it { should contain_service('neutron-bgp-dragent').with(
|
it { should contain_service('neutron-bgp-dragent').with(
|
||||||
:ensure => 'stopped',
|
:ensure => 'stopped',
|
||||||
:name => platform_params[:bgp_dragent_service],
|
:name => platform_params[:bgp_dragent_service],
|
||||||
@ -212,8 +212,8 @@ describe 'neutron::agents::bgp_dragent' do
|
|||||||
case facts[:osfamily]
|
case facts[:osfamily]
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
{
|
{
|
||||||
:dynamic_routing_package => 'openstack-neutron-dynamic-routing',
|
:dynamic_routing_package => false,
|
||||||
:bgp_dragent_package => false,
|
:bgp_dragent_package => 'openstack-neutron-bgp-dragent',
|
||||||
:bgp_dragent_service => 'neutron-bgp-dragent',
|
:bgp_dragent_service => 'neutron-bgp-dragent',
|
||||||
}
|
}
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
|
@ -23,7 +23,7 @@ $LOAD_PATH.push(
|
|||||||
|
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
provider_class = Puppet::Type.type(:neutron_bgp_dragent_config).provider(:openstackconfig)
|
provider_class = Puppet::Type.type(:neutron_bgp_dragent_config).provider(:ini_setting)
|
||||||
|
|
||||||
describe provider_class do
|
describe provider_class do
|
||||||
|
|
Loading…
Reference in New Issue
Block a user