Handle situation when endpoint deleted
when the cinder services exist but endpoint deleted, accessing
to /project/access_and_security will cause an error:
IndexError: list index out of range
Change-Id: Iad7f72cd5247f33245f25a8092c40a4d3a04cef9
Partial-Bug: #1394900
(cherry picked from commit 7985cfce77
)
This commit is contained in:
parent
184f5a6380
commit
9fa3d6a30e
|
@ -216,7 +216,7 @@ def get_service_from_catalog(catalog, service_type):
|
|||
|
||||
|
||||
def get_version_from_service(service):
|
||||
if service:
|
||||
if service and service.get('endpoints'):
|
||||
endpoint = service['endpoints'][0]
|
||||
if 'interface' in endpoint:
|
||||
return 3
|
||||
|
|
Loading…
Reference in New Issue