Remove deprecated resource types to manage volume type

... because they are redundant wrappers of cinder_type and were
deprecated.

Change-Id: I0d5fb5625946e7322f6b2a56333434ee957bcc11
This commit is contained in:
Takashi Kajinami 2021-12-17 08:58:56 +09:00
parent d944a76b95
commit f0ed794d71
5 changed files with 5 additions and 166 deletions

View File

@ -1,44 +0,0 @@
# == Define: cinder::type
#
# Creates cinder type and assigns backends.
# Deprecated class.
#
# === Parameters
#
# [*set_key*]
# (Optional) Must be used with set_value. Accepts a single string be used
# as the key in type_set
# Defaults to 'undef'.
#
# [*set_value*]
# (optional) Accepts list of strings or singular string. A list of values
# passed to type_set
# Defaults to 'undef'.
#
# Author: Andrew Woodward <awoodward@mirantis.com>
#
define cinder::type (
$set_key = undef,
$set_value = undef,
) {
include cinder::deps
warning('The cinder::type is deprecated, please use the cinder_type resource.')
if ($set_value and $set_key) {
if is_array($set_value) {
$value = join($set_value, ',')
} else {
$value = $set_value
}
cinder_type { $name:
ensure => present,
properties => ["${set_key}=${value}"],
}
} else {
cinder_type { $name:
ensure => present,
}
}
}

View File

@ -1,33 +0,0 @@
# ==Define: cinder::type_set
#
# Assigns keys after the volume type is set.
# Deprecated class.
#
# === Parameters
#
# [*type*]
# (required) Accepts single name of type to set.
#
# [*key*]
# (required) the key name that we are setting the value for.
#
# [*value*]
# the value that we are setting. Defaults to content of namevar.
#
# Author: Andrew Woodward <awoodward@mirantis.com>
#
define cinder::type_set (
$type,
$key,
$value = $name,
) {
include cinder::deps
warning('The cinder::type_set class is deprecated, please use the cinder_type resource instead.')
cinder_type { $type:
ensure => present,
properties => ["${key}=${value}"],
}
}

View File

@ -0,0 +1,5 @@
---
upgrade:
- |
The ``cinder::type`` resource type and the ``cinder::type_set`` resource
type have been removed.

View File

@ -1,50 +0,0 @@
#Author: Andrew Woodward <awoodward@mirantis.com>
require 'spec_helper'
describe 'cinder::type_set' do
let(:title) {'hippo'}
let :default_params do
{
:type => 'sith',
:key => 'monchichi',
}
end
let :params do
default_params
end
shared_examples 'cinder::type_set' do
context 'by default' do
it { is_expected.to contain_cinder_type('sith').with(
:ensure => 'present',
:properties => ['monchichi=hippo']
)}
end
context 'with a different value' do
before do
params.merge!( :value => 'hippi' )
end
it { is_expected.to contain_cinder_type('sith').with(
:ensure => 'present',
:properties => ['monchichi=hippi']
)}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'cinder::type_set'
end
end
end

View File

@ -1,39 +0,0 @@
#Author: Andrew Woodward <awoodward@mirantis.com>
require 'spec_helper'
describe 'cinder::type' do
let(:title) {'hippo'}
shared_examples 'cinder::type' do
context 'default creation' do
it { is_expected.to contain_cinder_type('hippo').with_ensure('present') }
end
context 'creation with properties' do
let :params do
{
:set_value => ['name1', 'name2'],
:set_key => 'volume_backend_name',
}
end
it { is_expected.to contain_cinder_type('hippo').with(
:ensure => 'present',
:properties => ['volume_backend_name=name1,name2']
)}
end
end
on_supported_os({
:supported_os => OSDefaults.get_supported_os
}).each do |os,facts|
context "on #{os}" do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'cinder::type'
end
end
end