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,28 +16,22 @@
# #
# 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 { # Maybe this could be extended to dynamically find the enabled names
warning("Configurations that are setting backend config in ``[DEFAULT]`` \ cinder_config {
section are now not supported. You should use ``enabled_backends``option to \ 'DEFAULT/enabled_backends': value => join($enabled_backends, ',');
set up backends. No volume service(s) started successfully otherwise.") }
} else {
# Maybe this could be extended to dynamically find the enabled names
cinder_config {
'DEFAULT/enabled_backends': value => join($enabled_backends, ',');
}
$enabled_backends.each |$backend| { $enabled_backends.each |$backend| {
# Avoid colliding with code in backend/rbd.pp # Avoid colliding with code in backend/rbd.pp
unless defined(Cinder_config["${backend}/backend_host"]) { unless defined(Cinder_config["${backend}/backend_host"]) {
cinder_config { cinder_config {
"${backend}/backend_host": value => $backend_host; "${backend}/backend_host": value => $backend_host;
}
} }
} }
} }