Commit df28c49b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

LUInstanceCreate: Include group name in error message



“pnode.group” contains the UUID, which isn't very user-friendly.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarBernardo Dal Seno <bdalseno@google.com>
parent e80aeb89
......@@ -10007,10 +10007,9 @@ class LUInstanceCreate(LogicalUnit):
ipolicy = ganeti.masterd.instance.CalculateGroupIPolicy(cluster, group_info)
res = _ComputeIPolicyInstanceSpecViolation(ipolicy, ispec)
if not self.op.ignore_ipolicy and res:
raise errors.OpPrereqError(("Instance allocation to group %s violates"
" policy: %s") % (pnode.group,
utils.CommaJoin(res)),
errors.ECODE_INVAL)
msg = ("Instance allocation to group %s (%s) violates policy: %s" %
(pnode.group, group_info.name, utils.CommaJoin(res)))
raise errors.OpPrereqError(msg, errors.ECODE_INVAL)
 
if not self.adopt_disks:
if self.op.disk_template == constants.DT_RBD:
......
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