From 16ce7f1cce3bab16dbef51ca0fc1eebfa2606276 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 28 Mar 2024 14:52:53 +0900 Subject: [PATCH] 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 --- manifests/backends.pp | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/manifests/backends.pp b/manifests/backends.pp index 6ec5c78c..d973b593 100644 --- a/manifests/backends.pp +++ b/manifests/backends.pp @@ -16,28 +16,22 @@ # # Author: Andrew Woodward class cinder::backends ( - $enabled_backends = undef, + Array[String[1], 1] $enabled_backends, $backend_host = $facts['os_service_default'], ) { 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 - cinder_config { - 'DEFAULT/enabled_backends': value => join($enabled_backends, ','); - } + # Maybe this could be extended to dynamically find the enabled names + cinder_config { + 'DEFAULT/enabled_backends': value => join($enabled_backends, ','); + } - $enabled_backends.each |$backend| { - # Avoid colliding with code in backend/rbd.pp - unless defined(Cinder_config["${backend}/backend_host"]) { - cinder_config { - "${backend}/backend_host": value => $backend_host; - } + $enabled_backends.each |$backend| { + # Avoid colliding with code in backend/rbd.pp + unless defined(Cinder_config["${backend}/backend_host"]) { + cinder_config { + "${backend}/backend_host": value => $backend_host; } } }