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

gnt-node: Use new opcode to migrate node

Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 80cb875c
......@@ -299,20 +299,8 @@ def MigrateNode(opts, args):
(",".join("'%s'" % name for name in pinst))):
return 2
jex = JobExecutor(cl=cl)
for iname in pinst:
op = opcodes.OpMigrateInstance(instance_name=iname,,
jex.QueueJob(iname, op)
results = jex.GetResults()
bad_cnt = len([row for row in results if not row[0]])
if bad_cnt == 0:
ToStdout("All %d instance(s) migrated successfully.", len(results))
ToStdout("There were errors during the migration:\n"
"%d error(s) out of %d instance(s).", bad_cnt, len(results))
return retcode
op = opcodes.OpMigrateNode(node_name=args[0],
SubmitOpCode(op, cl=cl)
def ShowNodeConfig(opts, args):
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