Merge "Try Fetching value from 'cluster' when raise exception"

This commit is contained in:
Zuul 2017-11-22 06:27:57 +00:00 committed by Gerrit Code Review
commit db41ac898b

View File

@ -142,7 +142,9 @@ class VolumeManageController(wsgi.Controller):
volume['ref'], volume['ref'],
**kwargs) **kwargs)
except exception.ServiceNotFound: except exception.ServiceNotFound:
msg = _("Host '%s' not found") % volume['host'] msg = _("%(name)s '%(value)s' not found") % {
'name': 'Host' if host else 'Cluster',
'value': host or cluster_name}
raise exception.ServiceUnavailable(message=msg) raise exception.ServiceUnavailable(message=msg)
utils.add_visible_admin_metadata(new_volume) utils.add_visible_admin_metadata(new_volume)