Merge "Remove deprecated pci_passthrough from nova::compute"

This commit is contained in:
Zuul
2022-02-17 19:43:22 +00:00
committed by Gerrit Code Review
5 changed files with 10 additions and 76 deletions

View File

@@ -270,14 +270,6 @@
# pinned and unpinned instances on the same host.
# Defaults to undef
#
# [*pci_passthrough*]
# DEPRECATED. Use nova::compute::pci::passthrough instead.
# (optional) Pci passthrough list of hash.
# Defaults to undef
# Example of format:
# [ { "vendor_id" => "1234","product_id" => "5678" },
# { "vendor_id" => "4321","product_id" => "8765", "physical_network" => "default" } ]
#
# [*keymgr_backend*]
# (optional) Key Manager service class.
# Example of valid value: castellan.key_manager.barbican_key_manager.BarbicanKeyManager
@@ -349,7 +341,6 @@ class nova::compute (
$block_device_allocate_retries_interval = $::os_service_default,
# DEPRECATED PARAMETERS
$vcpu_pin_set = undef,
$pci_passthrough = undef,
$keymgr_backend = undef,
$barbican_auth_endpoint = undef,
$barbican_endpoint = undef,
@@ -365,10 +356,6 @@ class nova::compute (
$image_type_exclude_list_real = pick(join(any2array($image_type_exclude_list), ','), $::os_service_default)
include nova::pci
if $pci_passthrough {
# Note: also remove the pick from nova::compute::pci
warning('The pci_passthrough parameter is deprecated and will be removed in X. Please use nova::compute::pci::passthrough instead.')
}
include nova::compute::pci
# TODO(tkajinam): Replace this by nova::compute::mdev when we remove

View File

@@ -16,16 +16,14 @@ class nova::compute::pci(
) {
include nova::deps
$picked_passthrough = pick_default($::nova::compute::pci_passthrough,$passthrough)
if $picked_passthrough and
!is_service_default($picked_passthrough) and
!empty($picked_passthrough) {
$passthrough_real = to_array_of_json_strings($picked_passthrough)
if $passthrough and
!is_service_default($passthrough) and
!empty($passthrough) {
$passthrough_real = to_array_of_json_strings($passthrough)
} else {
$passthrough_real = $::os_service_default
}
nova_config {
'pci/passthrough_whitelist': value => $passthrough_real;
}
}
}

View File

@@ -0,0 +1,4 @@
---
upgrade:
- |
The ``nova::compute::pci_passthrough`` parameter has been removed.

View File

@@ -82,4 +82,4 @@ describe 'nova::compute::pci' do
it_configures 'nova-compute-pci'
end
end
end
end

View File

@@ -80,11 +80,6 @@ describe 'nova::compute' do
is_expected.to contain_package(platform_params[:mkisofs_package]).that_requires('Anchor[nova::install::begin]')
is_expected.to contain_package(platform_params[:mkisofs_package]).that_comes_before('Anchor[nova::install::end]')
end
it 'configures nova pci_passthrough_whitelist' do
is_expected.to contain_class('nova::compute::pci')
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '<SERVICE DEFAULT>')
end
end
context 'with overridden parameters' do
@@ -226,56 +221,6 @@ describe 'nova::compute' do
end
end
context 'with pci params array' do
let :params do
{
:pci_passthrough => [
{
"vendor_id" => "8086",
"product_id" => "0126"
},
{
"vendor_id" => "9096",
"product_id" => "1520",
"physical_network" => "physnet1"
}
],
}
end
it 'configures nova pci_passthrough_whitelist entries' do
is_expected.to contain_class('nova::compute::pci')
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(
'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}']
)
end
end
context 'with pci params JSON encoded string (deprecated)' do
let :params do
{
:pci_passthrough => "[{\"vendor_id\":\"8086\",\"product_id\":\"0126\"},{\"vendor_id\":\"9096\",\"product_id\":\"1520\",\"physical_network\":\"physnet1\"}]",
}
end
it 'configures nova pci_passthrough_whitelist entries' do
is_expected.to contain_class('nova::compute::pci')
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(
'value' => ['{"vendor_id":"8086","product_id":"0126"}','{"vendor_id":"9096","product_id":"1520","physical_network":"physnet1"}']
)
end
end
context 'when vcpu_pin_set and pci params are empty' do
let :params do
{ :pci_passthrough => ""}
end
it 'clears pci_passthrough configuration' do
is_expected.to contain_class('nova::compute::pci')
is_expected.to contain_nova_config('pci/passthrough_whitelist').with(:value => '<SERVICE DEFAULT>')
end
end
context 'with reserved_huge_pages array' do
let :params do
{