Commit c8bde61e authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix grow-disk handling of invalid units

The reason why grow-disk was doing:

$ gnt-instance grow-disk instance3 0 -64
Unhandled Ganeti error: Invalid format

Is because it does it's own ParseUnit call, and doesn't transform that
into a nicer message.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarRené Nussbaumer <>
parent 59e67682
......@@ -660,7 +660,11 @@ def GrowDisk(opts, args):
except (TypeError, ValueError), err:
raise errors.OpPrereqError("Invalid disk index: %s" % str(err),
amount = utils.ParseUnit(args[2])
amount = utils.ParseUnit(args[2])
except errors.UnitParseError:
raise errors.OpPrereqError("Can't parse the given amount '%s'" % args[2],
op = opcodes.OpInstanceGrowDisk(instance_name=instance,
disk=disk, amount=amount,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment