From 502aec2406e59806d23e8d857920d5d8f2ca6cd3 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 18 Aug 2022 01:25:37 +0900 Subject: [PATCH] Adapt to the new [pci] device_spec parameter and replaces the deprecated [pci] passthrough_whitelist parameter. Depends-on: https://review.opendev.org/c/openstack/nova/+/843834 Change-Id: Ia534d2acd8f5488b1358376bb5bd1f0f7302fbaa --- manifests/compute/pci.pp | 7 ++++++- spec/classes/nova_compute_pci_spec.rb | 20 ++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/manifests/compute/pci.pp b/manifests/compute/pci.pp index bff9ef716..02f910b85 100644 --- a/manifests/compute/pci.pp +++ b/manifests/compute/pci.pp @@ -24,6 +24,11 @@ class nova::compute::pci( $passthrough_real = $::os_service_default } nova_config { - 'pci/passthrough_whitelist': value => $passthrough_real; + 'pci/device_spec': value => $passthrough_real; + } + + # TODO(tkajinam): Remove this after Zed release. + nova_config { + 'pci/passthrough_whitelist': ensure => absent; } } diff --git a/spec/classes/nova_compute_pci_spec.rb b/spec/classes/nova_compute_pci_spec.rb index facee520c..6ca421efa 100644 --- a/spec/classes/nova_compute_pci_spec.rb +++ b/spec/classes/nova_compute_pci_spec.rb @@ -4,8 +4,8 @@ describe 'nova::compute::pci' do shared_examples_for 'nova-compute-pci' do context 'with default parameters' do - it 'clears pci_passthrough_whitelist configuration' do - is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '') + it 'clears pci device_spec configuration' do + is_expected.to contain_nova_config('pci/device_spec').with(:value => '') end end @@ -25,8 +25,8 @@ describe 'nova::compute::pci' do ], } end - it 'configures nova pci_passthrough_whitelist entries' do - is_expected.to contain_nova_config('pci/passthrough_whitelist').with( + it 'configures nova pci device_spec entries' do + is_expected.to contain_nova_config('pci/device_spec').with( 'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}'] ) end @@ -39,8 +39,8 @@ describe 'nova::compute::pci' do } end - it 'configures nova pci_passthrough_whitelist entries' do - is_expected.to contain_nova_config('pci/passthrough_whitelist').with( + it 'configures nova pci device_spec entries' do + is_expected.to contain_nova_config('pci/device_spec').with( 'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}'] ) end @@ -53,8 +53,8 @@ describe 'nova::compute::pci' do } end - it 'clears pci_passthrough_whitelist configuration' do - is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '') + it 'clears pci device_spec configuration' do + is_expected.to contain_nova_config('pci/device_spec').with(:value => '') end end @@ -65,8 +65,8 @@ describe 'nova::compute::pci' do } end - it 'clears pci_passthrough_whitelist configuration' do - is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '') + it 'clears pci device_spec configuration' do + is_expected.to contain_nova_config('pci/device_spec').with(:value => '') end end end