From ea9dc5727813ca363b3965d69124b374ef9b9932 Mon Sep 17 00:00:00 2001 From: Arx Cruz Date: Wed, 31 May 2023 13:52:15 +0200 Subject: [PATCH] Handle when there is no volume backend available We query the volume pools to check if the user has permissions to list the backend storage, but we do not handle when the volume backend is not available, only when the user is not allowed. This patch adds the ServiceError exception to handle it and set the backend properly. Change-Id: I0fd61813dbadf5ef3a0db55791e3b261d4c9d885 --- config_tempest/services/volume.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config_tempest/services/volume.py b/config_tempest/services/volume.py index 3c4c1c92..7e4228cc 100644 --- a/config_tempest/services/volume.py +++ b/config_tempest/services/volume.py @@ -17,6 +17,7 @@ import json import re from config_tempest import constants as C +from config_tempest.services.base import ServiceError from config_tempest.services.base import VersionedService from tempest.lib import exceptions @@ -51,6 +52,9 @@ class VolumeService(VersionedService): C.LOG.warning("User has no permissions to list back-end storage " "pools - storage back-ends can't be discovered.") return + except ServiceError: + C.LOG.warning("Volume backend doesn't exist.") + return if pools: backends = [ re.findall(r'(\w*)@(\w*)', pool['name'])[0][1]