Revision efae0fdd lib/client/gnt_node.py
b/lib/client/gnt_node.py | ||
---|---|---|
105 | 105 |
help=("Do not make initial SSH setup on remote" |
106 | 106 |
" node (needs to be done manually)")) |
107 | 107 |
|
108 |
IGNORE_STATUS_OPT = cli_option("--ignore-status", default=False, |
|
109 |
action="store_true", dest="ignore_status", |
|
110 |
help=("Ignore the Node(s) offline status" |
|
111 |
" (potentially DANGEROUS)")) |
|
112 |
|
|
113 |
FORCE_MASTER_OPT = cli_option("--force-master", default=False, |
|
114 |
action="store_true", dest="force_master", |
|
115 |
help=("Operate on the master node too" |
|
116 |
" (potentially DANGEROUS)")) |
|
117 |
|
|
108 | 118 |
|
109 | 119 |
def ConvertStorageType(user_storage_type): |
110 | 120 |
"""Converts a user storage type to its internal name. |
... | ... | |
487 | 497 |
oob_command = "power-%s" % command |
488 | 498 |
|
489 | 499 |
opcodelist = [] |
490 |
if oob_command == constants.OOB_POWER_OFF: |
|
500 |
if not opts.ignore_status and oob_command == constants.OOB_POWER_OFF:
|
|
491 | 501 |
opcodelist.append(opcodes.OpNodeSetParams(node_name=node, offline=True, |
492 | 502 |
auto_promote=opts.auto_promote)) |
493 | 503 |
|
494 | 504 |
opcodelist.append(opcodes.OpOobCommand(node_names=[node], |
495 |
command=oob_command)) |
|
505 |
command=oob_command, |
|
506 |
ignore_status=opts.ignore_status, |
|
507 |
force_master=opts.force_master)) |
|
496 | 508 |
|
497 | 509 |
cli.SetGenericOpcodeOpts(opcodelist, opts) |
498 | 510 |
|
... | ... | |
815 | 827 |
PowerNode, |
816 | 828 |
[ArgChoice(min=1, max=1, choices=_LIST_POWER_COMMANDS), |
817 | 829 |
ArgNode(min=1, max=1)], |
818 |
[SUBMIT_OPT, AUTO_PROMOTE_OPT, PRIORITY_OPT], |
|
830 |
[SUBMIT_OPT, AUTO_PROMOTE_OPT, PRIORITY_OPT, IGNORE_STATUS_OPT, |
|
831 |
FORCE_MASTER_OPT], |
|
819 | 832 |
"on|off|cycle|status <node>", |
820 | 833 |
"Change power state of node by calling out-of-band helper."), |
821 | 834 |
'remove': ( |
Also available in: Unified diff