From 9b02f455750586de078cdd8462db4c2847bb2b8f Mon Sep 17 00:00:00 2001 From: Tobias Urdin Date: Tue, 17 Jul 2018 16:24:43 +0200 Subject: [PATCH] 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 --- .../{openstackconfig.rb => ini_setting.rb} | 4 +-- manifests/agents/bgp_dragent.pp | 6 ++-- manifests/params.pp | 4 +-- .../neutron_agents_bgp_dragent_spec.rb | 28 +++++++++---------- ...tackconfig_spec.rb => ini_setting_spec.rb} | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) rename lib/puppet/provider/neutron_bgp_dragent_config/{openstackconfig.rb => ini_setting.rb} (73%) rename spec/unit/provider/neutron_bgp_dragent_config/{openstackconfig_spec.rb => ini_setting_spec.rb} (98%) diff --git a/lib/puppet/provider/neutron_bgp_dragent_config/openstackconfig.rb b/lib/puppet/provider/neutron_bgp_dragent_config/ini_setting.rb similarity index 73% rename from lib/puppet/provider/neutron_bgp_dragent_config/openstackconfig.rb rename to lib/puppet/provider/neutron_bgp_dragent_config/ini_setting.rb index 02aa6b32b..c11ba58b8 100644 --- a/lib/puppet/provider/neutron_bgp_dragent_config/openstackconfig.rb +++ b/lib/puppet/provider/neutron_bgp_dragent_config/ini_setting.rb @@ -1,6 +1,6 @@ Puppet::Type.type(:neutron_bgp_dragent_config).provide( - :openstackconfig, - :parent => Puppet::Type.type(:openstack_config).provider(:ruby) + :ini_setting, + :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) ) do def self.file_path diff --git a/manifests/agents/bgp_dragent.pp b/manifests/agents/bgp_dragent.pp index 92f13465f..2638b987a 100644 --- a/manifests/agents/bgp_dragent.pp +++ b/manifests/agents/bgp_dragent.pp @@ -43,7 +43,7 @@ # # [*purge_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( $package_ensure = 'present', @@ -62,8 +62,8 @@ class neutron::agents::bgp_dragent( } neutron_bgp_dragent_config { - 'BGP/bgp_speaker_driver': value => $bgp_speaker_driver; - 'BGP/bgp_router_id': value => $bgp_router_id; + 'bgp/bgp_speaker_driver': value => $bgp_speaker_driver; + 'bgp/bgp_router_id': value => $bgp_router_id; } if $::neutron::params::dynamic_routing_package { diff --git a/manifests/params.pp b/manifests/params.pp index 8edc75e41..da4dfe34f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -77,8 +77,8 @@ class neutron::params { $l2gw_agent_package = 'openstack-neutron-l2gw-agent' $l2gw_package = 'python2-networking-l2gw' $ovn_metadata_agent_package = 'python-networking-ovn-metadata-agent' - $dynamic_routing_package = 'openstack-neutron-dynamic-routing' - $bgp_dragent_package = false + $dynamic_routing_package = false + $bgp_dragent_package = 'openstack-neutron-bgp-dragent' if $::operatingsystemrelease =~ /^7.*/ or $::operatingsystem == 'Fedora' { $openswan_package = 'libreswan' } else { diff --git a/spec/classes/neutron_agents_bgp_dragent_spec.rb b/spec/classes/neutron_agents_bgp_dragent_spec.rb index 06dc9a183..3d5ef444f 100644 --- a/spec/classes/neutron_agents_bgp_dragent_spec.rb +++ b/spec/classes/neutron_agents_bgp_dragent_spec.rb @@ -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_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_speaker_driver').with_value(default_params[:bgp_speaker_driver]) } + it { should contain_neutron_bgp_dragent_config('bgp/bgp_router_id').with_value(facts[:ipaddress]) } end context 'with overridden params' do @@ -52,21 +52,21 @@ describe 'neutron::agents::bgp_dragent' do end 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_router_id').with_value('4.3.2.1') } + 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') } end end shared_examples 'neutron::agents::bgp_dragent on RedHat' 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], - :name => platform_params[:dynamic_routing_package], + :name => platform_params[:bgp_dragent_package], :tag => ['openstack', 'neutron-package'], )} - it { should_not contain_package('neutron-bgp-dragent') } - it { should contain_service('neutron-bgp-dragent').with( :ensure => 'running', :name => platform_params[:bgp_dragent_service], @@ -81,14 +81,14 @@ describe 'neutron::agents::bgp_dragent' do :enabled => false ) 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', - :name => platform_params[:dynamic_routing_package], + :name => platform_params[:bgp_dragent_package], :tag => ['openstack', 'neutron-package'], )} - it { should_not contain_package('neutron-bgp-dragent') } - it { should contain_service('neutron-bgp-dragent').with( :ensure => 'stopped', :name => platform_params[:bgp_dragent_service], @@ -212,8 +212,8 @@ describe 'neutron::agents::bgp_dragent' do case facts[:osfamily] when 'RedHat' { - :dynamic_routing_package => 'openstack-neutron-dynamic-routing', - :bgp_dragent_package => false, + :dynamic_routing_package => false, + :bgp_dragent_package => 'openstack-neutron-bgp-dragent', :bgp_dragent_service => 'neutron-bgp-dragent', } when 'Debian' diff --git a/spec/unit/provider/neutron_bgp_dragent_config/openstackconfig_spec.rb b/spec/unit/provider/neutron_bgp_dragent_config/ini_setting_spec.rb similarity index 98% rename from spec/unit/provider/neutron_bgp_dragent_config/openstackconfig_spec.rb rename to spec/unit/provider/neutron_bgp_dragent_config/ini_setting_spec.rb index 9f25ad148..a6a9b7e75 100644 --- a/spec/unit/provider/neutron_bgp_dragent_config/openstackconfig_spec.rb +++ b/spec/unit/provider/neutron_bgp_dragent_config/ini_setting_spec.rb @@ -23,7 +23,7 @@ $LOAD_PATH.push( 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