Remove deprecated mdev_types_device_addresses_mapping
This parameter was deprecated during Yoga cycle in favor of the new
mdev_types parameter[1].
[1] 0be9d0a3c7
Change-Id: Idad6f62157ee637be64cee585beafe292efc9c15
This commit is contained in:
parent
d8739ad539
commit
f16181f25c
@ -8,39 +8,14 @@
|
||||
# (Optional) A hash to define the nova::compute::mdev_type resources.
|
||||
# Defaults to {}
|
||||
#
|
||||
# DEPRECATED PARAMETERS
|
||||
#
|
||||
# [*mdev_types_device_addresses_mapping*]
|
||||
# (Optional) Map of mdev type(s) the instances can get as key and list of
|
||||
# corresponding device addresses as value.
|
||||
# Defaults to undef
|
||||
#
|
||||
class nova::compute::mdev(
|
||||
$mdev_types = {},
|
||||
# DEPRECATED PARAMETERS
|
||||
$mdev_types_device_addresses_mapping = undef,
|
||||
$mdev_types = {},
|
||||
) {
|
||||
include nova::deps
|
||||
|
||||
validate_legacy(Hash, 'validate_hash', $mdev_types)
|
||||
if $mdev_types_device_addresses_mapping != undef {
|
||||
warning('mdev_types_device_addresses_mapping is deprecated. Use mdev_types.')
|
||||
validate_legacy(Hash, 'validate_hash', $mdev_types_device_addresses_mapping)
|
||||
}
|
||||
|
||||
$dev_addr_mapping_real = pick_default($mdev_types_device_addresses_mapping, {})
|
||||
|
||||
if !empty($dev_addr_mapping_real) {
|
||||
nova_config {
|
||||
'devices/enabled_mdev_types': value => join(keys($dev_addr_mapping_real), ',');
|
||||
}
|
||||
|
||||
$dev_addr_mapping_real.each |$mdev_type, $device_addresses| {
|
||||
nova::compute::mdev_type { $mdev_type :
|
||||
device_addresses => $device_addresses;
|
||||
}
|
||||
}
|
||||
} elsif !empty($mdev_types) {
|
||||
if !empty($mdev_types) {
|
||||
nova_config {
|
||||
'devices/enabled_mdev_types': value => join(keys($mdev_types), ',')
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
upgrade:
|
||||
- |
|
||||
The ``nova::compute::mdev::mdev_types_device_addresses_mapping`` parameter
|
||||
has been removed.
|
@ -37,43 +37,6 @@ describe 'nova::compute::mdev' do
|
||||
is_expected.to contain_nova_config('mdev_nvidia-37/mdev_class').with_value('VGPU')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with device addresses mapping' do
|
||||
context 'with a single mdev type' do
|
||||
let :params do
|
||||
{
|
||||
:mdev_types_device_addresses_mapping => {
|
||||
"nvidia-35" => []
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures mdev devices' do
|
||||
is_expected.to contain_nova_config('devices/enabled_mdev_types').with_value('nvidia-35')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-35/device_addresses').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-35/mdev_class').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with multiple mdev types' do
|
||||
let :params do
|
||||
{
|
||||
:mdev_types_device_addresses_mapping => {
|
||||
'nvidia-35' => ['0000:84:00.0', '0000:85:00.0'],
|
||||
'nvidia-36' => []
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
it 'configures mdev devices' do
|
||||
is_expected.to contain_nova_config('devices/enabled_mdev_types').with_value('nvidia-35,nvidia-36')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-35/device_addresses').with_value('0000:84:00.0,0000:85:00.0')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-35/mdev_class').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-36/device_addresses').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_nova_config('mdev_nvidia-36/mdev_class').with_value('<SERVICE DEFAULT>')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
Loading…
Reference in New Issue
Block a user