Merge "Print a more informative error message on misconfigured volumes"

This commit is contained in:
Zuul 2018-06-16 21:32:57 +00:00 committed by Gerrit Code Review
commit c166f60ccb
1 changed files with 5 additions and 1 deletions

View File

@ -96,7 +96,11 @@ def pull_image(name):
def match_config_volumes(prefix, config):
# Match the mounted config volumes - we can't just use the
# key as e.g "novacomute" consumes config-data/nova
volumes = config.get('volumes', [])
try:
volumes = config.get('volumes', [])
except AttributeError:
log.error('Error fetching volumes. Prefix: %s - Config: %s' % (prefix, config))
raise
return sorted([os.path.dirname(v.split(":")[0]) for v in volumes if
v.startswith(prefix)])