From da74d1d672663cfc6a77ca6cf6cf7df10f178922 Mon Sep 17 00:00:00 2001 From: TommyLike Date: Mon, 20 Nov 2017 16:36:54 +0800 Subject: [PATCH] Try Fetching value from 'cluster' when raise exception Cluster is supported in cinder manage API. We should try to fetch the user input from 'cluster' as well when raising exception. TrivialFix Closes-Bug: #1732455 Change-Id: I2921113d89662c346ff75081dc7c5ce24ca6c5e2 --- cinder/api/contrib/volume_manage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cinder/api/contrib/volume_manage.py b/cinder/api/contrib/volume_manage.py index bdb4c886cce..dfc2f915a31 100644 --- a/cinder/api/contrib/volume_manage.py +++ b/cinder/api/contrib/volume_manage.py @@ -142,7 +142,9 @@ class VolumeManageController(wsgi.Controller): volume['ref'], **kwargs) 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) utils.add_visible_admin_metadata(new_volume)