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:
parent
eca54c4743
commit
ea9dc57278
@ -17,6 +17,7 @@ import json
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from config_tempest import constants as C
|
from config_tempest import constants as C
|
||||||
|
from config_tempest.services.base import ServiceError
|
||||||
from config_tempest.services.base import VersionedService
|
from config_tempest.services.base import VersionedService
|
||||||
|
|
||||||
from tempest.lib import exceptions
|
from tempest.lib import exceptions
|
||||||
@ -51,6 +52,9 @@ class VolumeService(VersionedService):
|
|||||||
C.LOG.warning("User has no permissions to list back-end storage "
|
C.LOG.warning("User has no permissions to list back-end storage "
|
||||||
"pools - storage back-ends can't be discovered.")
|
"pools - storage back-ends can't be discovered.")
|
||||||
return
|
return
|
||||||
|
except ServiceError:
|
||||||
|
C.LOG.warning("Volume backend doesn't exist.")
|
||||||
|
return
|
||||||
if pools:
|
if pools:
|
||||||
backends = [
|
backends = [
|
||||||
re.findall(r'(\w*)@(\w*)', pool['name'])[0][1]
|
re.findall(r'(\w*)@(\w*)', pool['name'])[0][1]
|
||||||
|
Loading…
Reference in New Issue
Block a user