Modify the prompt of update volume
On the update volume page, when the name is empty,
there is a problem with the prompt information.
Closes-Bug:
@@ -657,7 +657,7 @@ class UpdateForm(forms.SelfHandlingForm):
def handle(self, request, data):
volume_id = self.initial['volume_id']
try:
- cinder.volume_update(request, volume_id, data['name'],
+ volume = cinder.volume_update(request, volume_id, data['name'],
data['description'])
except Exception:
redirect = reverse("horizon:project:volumes:index")
@@ -676,7 +676,8 @@ class UpdateForm(forms.SelfHandlingForm):
_('Unable to set bootable flag on volume.'),
redirect=redirect)
- message = _('Updating volume "%s"') % data['name']
+ name_or_id = volume["volume"]["name"] or volume["volume"]["id"]
+ message = _('Updating volume "%s"') % name_or_id
messages.info(request, message)
return True
