- op = opcodes.OpOobCommand(node_name=node, command=oob_command)
- result = SubmitOpCode(op, opts=opts)
+ opcodelist = []
+ if oob_command == constants.OOB_POWER_OFF:
+ opcodelist.append(opcodes.OpSetNodeParams(node_name=node, offline=True,
+ auto_promote=opts.auto_promote))
+
+ opcodelist.append(opcodes.OpOobCommand(node_name=node, command=oob_command))
+
+ cli.SetGenericOpcodeOpts(opcodelist, opts)
+
+ job_id = cli.SendJob(opcodelist)
+
+ # We just want the OOB Opcode status
+ # If it fails PollJob gives us the error message in it
+ result = cli.PollJob(job_id)[-1]
+