Merge "Remove deprecated nova::compute::vgpu::enabled_vgpu_types"
This commit is contained in:
@@ -9,29 +9,12 @@
|
|||||||
# corresponding device addresses as value.
|
# corresponding device addresses as value.
|
||||||
# Defaults to {}
|
# Defaults to {}
|
||||||
#
|
#
|
||||||
# DEPRECATED PARAMETERS
|
|
||||||
#
|
|
||||||
# [*enabled_vgpu_types*]
|
|
||||||
# (optional) Specify which specific GPU type(s) the instances can get
|
|
||||||
# Defaults to undef
|
|
||||||
#
|
|
||||||
|
|
||||||
class nova::compute::vgpu(
|
class nova::compute::vgpu(
|
||||||
$vgpu_types_device_addresses_mapping = {},
|
$vgpu_types_device_addresses_mapping = {},
|
||||||
# DEPRECATED PARAMETERS
|
|
||||||
$enabled_vgpu_types = undef,
|
|
||||||
) {
|
) {
|
||||||
include nova::deps
|
include nova::deps
|
||||||
|
|
||||||
if $enabled_vgpu_types {
|
if !empty($vgpu_types_device_addresses_mapping) {
|
||||||
warning('enabled_vgpu_types is deprecated, instead use vgpu_types_device_addresses_mapping parameter.')
|
|
||||||
}
|
|
||||||
|
|
||||||
if $enabled_vgpu_types != undef and !empty($enabled_vgpu_types) {
|
|
||||||
nova_config {
|
|
||||||
'devices/enabled_vgpu_types': value => join(any2array($enabled_vgpu_types), ',');
|
|
||||||
}
|
|
||||||
} elsif !empty($vgpu_types_device_addresses_mapping) {
|
|
||||||
validate_legacy(Hash, 'validate_hash', $vgpu_types_device_addresses_mapping)
|
validate_legacy(Hash, 'validate_hash', $vgpu_types_device_addresses_mapping)
|
||||||
$vgpu_types_real = keys($vgpu_types_device_addresses_mapping)
|
$vgpu_types_real = keys($vgpu_types_device_addresses_mapping)
|
||||||
nova_config {
|
nova_config {
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The ``nova::compute::vgpu::enabled_vgpu_types`` parameter has been removed.
|
@@ -9,19 +9,6 @@ describe 'nova::compute::vgpu' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with vgpu device' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:enabled_vgpu_types => "nvidia-35",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
it 'configures nova vgpu device entries' do
|
|
||||||
is_expected.to contain_nova_config('devices/enabled_vgpu_types').with(
|
|
||||||
'value' => 'nvidia-35'
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with vgpu types and device addresses mapping' do
|
context 'with vgpu types and device addresses mapping' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
@@ -32,20 +19,6 @@ describe 'nova::compute::vgpu' do
|
|||||||
it { is_expected.to contain_nova_config('vgpu_nvidia-35/device_addresses').with_ensure('absent') }
|
it { is_expected.to contain_nova_config('vgpu_nvidia-35/device_addresses').with_ensure('absent') }
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with multiple vgpu devices' do
|
|
||||||
let :params do
|
|
||||||
{
|
|
||||||
:enabled_vgpu_types => ["nvidia-35","nvidia-36"]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'configures nova vgpu device entries' do
|
|
||||||
is_expected.to contain_nova_config('devices/enabled_vgpu_types').with(
|
|
||||||
'value' => "nvidia-35,nvidia-36"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with multiple vgpu types and corresponding device addresses mapping' do
|
context 'with multiple vgpu types and corresponding device addresses mapping' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user