Merge "properly format error messages for volume resizing"

This commit is contained in:
Jenkins 2016-10-17 20:41:32 +00:00 committed by Gerrit Code Review
commit ed8e918519

View File

@ -484,10 +484,11 @@ class SetVolume(command.Command):
try: try:
if volume.status != 'available': if volume.status != 'available':
msg = (_("Volume is in %s state, it must be available " msg = (_("Volume is in %s state, it must be available "
"before size can be extended"), volume.status) "before size can be extended") % volume.status)
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
if parsed_args.size <= volume.size: if parsed_args.size <= volume.size:
msg = _("New size must be greater than %s GB"), volume.size msg = (_("New size must be greater than %s GB")
% volume.size)
raise exceptions.CommandError(msg) raise exceptions.CommandError(msg)
volume_client.volumes.extend(volume.id, parsed_args.size) volume_client.volumes.extend(volume.id, parsed_args.size)
except Exception as e: except Exception as e: