Require enabled_backends

... because cinder-volume can't launch without enabled_backends.

Also require a specific value type which can be properly handled by
the current logic.

Change-Id: Ic9756129f6e6aa14405b6f6d90618bfc2f03cabb
This commit is contained in:
Takashi Kajinami 2024-03-28 14:52:53 +09:00
parent 08052b3852
commit 16ce7f1cce

View File

@ -16,17 +16,12 @@
# #
# Author: Andrew Woodward <awoodward@mirantis.com> # Author: Andrew Woodward <awoodward@mirantis.com>
class cinder::backends ( class cinder::backends (
$enabled_backends = undef, Array[String[1], 1] $enabled_backends,
$backend_host = $facts['os_service_default'], $backend_host = $facts['os_service_default'],
) { ) {
include cinder::deps include cinder::deps
if $enabled_backends == undef {
warning("Configurations that are setting backend config in ``[DEFAULT]`` \
section are now not supported. You should use ``enabled_backends``option to \
set up backends. No volume service(s) started successfully otherwise.")
} else {
# Maybe this could be extended to dynamically find the enabled names # Maybe this could be extended to dynamically find the enabled names
cinder_config { cinder_config {
'DEFAULT/enabled_backends': value => join($enabled_backends, ','); 'DEFAULT/enabled_backends': value => join($enabled_backends, ',');
@ -41,4 +36,3 @@ set up backends. No volume service(s) started successfully otherwise.")
} }
} }
} }
}