Revision b04808ea lib/client/gnt_node.py
b/lib/client/gnt_node.py | ||
---|---|---|
491 | 491 |
opcodelist.append(opcodes.OpNodeSetParams(node_name=node, offline=True, |
492 | 492 |
auto_promote=opts.auto_promote)) |
493 | 493 |
|
494 |
opcodelist.append(opcodes.OpOobCommand(node_name=node, command=oob_command)) |
|
494 |
opcodelist.append(opcodes.OpOobCommand(node_names=[node], |
|
495 |
command=oob_command)) |
|
495 | 496 |
|
496 | 497 |
cli.SetGenericOpcodeOpts(opcodelist, opts) |
497 | 498 |
|
... | ... | |
502 | 503 |
result = cli.PollJob(job_id)[-1] |
503 | 504 |
|
504 | 505 |
if result: |
505 |
if oob_command == constants.OOB_POWER_STATUS:
|
|
506 |
text = "The machine is %spowered"
|
|
507 |
if result[constants.OOB_POWER_STATUS_POWERED]:
|
|
508 |
result = text % ""
|
|
506 |
(_, data_tuple) = result[0]
|
|
507 |
if data_tuple[0] != constants.RS_NORMAL:
|
|
508 |
if data_tuple[0] == constants.RS_UNAVAIL:
|
|
509 |
result = "OOB is not supported"
|
|
509 | 510 |
else: |
510 |
result = text % "not " |
|
511 |
ToStderr(result) |
|
511 |
result = "RPC failed, look out for warning in the output" |
|
512 |
ToStderr(result) |
|
513 |
return constants.EXIT_FAILURE |
|
514 |
else: |
|
515 |
if oob_command == constants.OOB_POWER_STATUS: |
|
516 |
text = "The machine is %spowered" |
|
517 |
if data_tuple[1][constants.OOB_POWER_STATUS_POWERED]: |
|
518 |
result = text % "" |
|
519 |
else: |
|
520 |
result = text % "not " |
|
521 |
ToStdout(result) |
|
512 | 522 |
|
513 | 523 |
return constants.EXIT_SUCCESS |
514 | 524 |
|
Also available in: Unified diff