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
This commit is contained in:
Arx Cruz 2023-05-31 13:52:15 +02:00 committed by Martin Kopec
parent eca54c4743
commit ea9dc57278

View File

@ -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]