From cd835dadfdb18de7dc337c29833b68cc3a8898cb Mon Sep 17 00:00:00 2001 From: Carlos Camacho Date: Fri, 10 Mar 2017 23:44:27 +0100 Subject: [PATCH] Fix sync_db in BGPVPN We need to add head to neutron-db-manage in order to run the command correctly. Change-Id: I2be0fab671ec1a804d029afc6dc27d19a193b064 --- manifests/services/bgpvpn.pp | 2 +- spec/classes/neutron_services_bgpvpn_spec.rb | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/manifests/services/bgpvpn.pp b/manifests/services/bgpvpn.pp index 8f6b310e9..f3df69ced 100644 --- a/manifests/services/bgpvpn.pp +++ b/manifests/services/bgpvpn.pp @@ -68,7 +68,7 @@ class neutron::services::bgpvpn ( if $sync_db { Package<| title == $::neutron::params::bgpvpn_plugin_package |> ~> Exec['bgpvpn-db-sync'] exec { 'bgpvpn-db-sync': - command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --subproject networking-bgpvpn upgrade', + command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --subproject networking-bgpvpn upgrade head', path => '/usr/bin', subscribe => [ Anchor['neutron::install::end'], diff --git a/spec/classes/neutron_services_bgpvpn_spec.rb b/spec/classes/neutron_services_bgpvpn_spec.rb index a13b726a5..301be0055 100644 --- a/spec/classes/neutron_services_bgpvpn_spec.rb +++ b/spec/classes/neutron_services_bgpvpn_spec.rb @@ -38,6 +38,19 @@ describe 'neutron::services::bgpvpn' do :name => platform_params[:bgpvpn_package_name], ) end + + it 'runs neutron-db-sync' do + is_expected.to contain_exec('bgpvpn-db-sync').with( + :command => 'neutron-db-manage --config-file /etc/neutron/neutron.conf --subproject networking-bgpvpn upgrade head', + :path => '/usr/bin', + :subscribe => ['Anchor[neutron::install::end]', + 'Anchor[neutron::config::end]', + 'Anchor[neutron::dbsync::begin]' + ], + :notify => 'Anchor[neutron::dbsync::end]', + :refreshonly => 'true', + ) + end end context 'with multiple service providers' do