add a separate datatype for servicedefault

Needed for non String types if they have a default
that points to facts['os_service_default'].
Otherwise we need to allow String for all parameters.

Since the function is_service_default checks the string,
I do not assume that the fact is overwritten in
any deployment !

Change-Id: Ic2b969f9b99d1748c80edb691f38f4451e499a80
This commit is contained in:
Benedikt Trefzer 2023-06-13 15:05:16 +02:00 committed by Takashi Kajinami
parent 60f964b7a0
commit a22990d4d5
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,33 @@
require 'spec_helper'
describe 'Openstacklib::ServiceDefault' do
describe 'valid types' do
context 'with valid types' do
[
'<SERVICE DEFAULT>',
].each do |value|
describe value.inspect do
it { is_expected.to allow_value(value) }
end
end
end
end
describe 'invalid types' do
context 'with garbage inputs' do
[
'somethink',
true,
nil,
{},
'',
55555,
].each do |value|
describe value.inspect do
it { is_expected.not_to allow_value(value) }
end
end
end
end
end

1
types/servicedefault.pp Normal file
View File

@ -0,0 +1 @@
type Openstacklib::ServiceDefault = Enum['<SERVICE DEFAULT>']