Browse Source

Merge pull request #7849 from tomassedovic/fix-7702-no-cinder

Fix OpenStack playbooks on clouds without Cinder
OpenShift Merge Robot 7 years ago
parent
commit
9468b954a1
1 changed files with 8 additions and 2 deletions
  1. 8 2
      playbooks/openstack/inventory.py

+ 8 - 2
playbooks/openstack/inventory.py

@@ -13,6 +13,7 @@ from collections import Mapping
 import json
 import os
 
+from keystoneauth1.exceptions.catalog import EndpointNotFound
 import shade
 
 
@@ -141,9 +142,14 @@ def build_inventory():
 
     inventory['_meta'] = {'hostvars': {}}
 
+    # Some clouds don't have Cinder. That's okay:
+    try:
+        volumes = cloud.list_volumes()
+    except EndpointNotFound:
+        volumes = []
+
     # cinder volumes used for docker storage
-    docker_storage_mountpoints = get_docker_storage_mountpoints(
-        cloud.list_volumes())
+    docker_storage_mountpoints = get_docker_storage_mountpoints(volumes)
     for server in cluster_hosts:
         inventory['_meta']['hostvars'][server.name] = _get_hostvars(
             server,