Revision c9d443ea scripts/gnt-node
b/scripts/gnt-node | ||
---|---|---|
419 | 419 |
@return: the desired exit code |
420 | 420 |
|
421 | 421 |
""" |
422 |
if opts.master_candidate is None and opts.offline is None:
|
|
422 |
if [opts.master_candidate, opts.drained, opts.offline].count(None) == 3:
|
|
423 | 423 |
ToStderr("Please give at least one of the parameters.") |
424 | 424 |
return 1 |
425 | 425 |
|
... | ... | |
431 | 431 |
offline = opts.offline == 'yes' |
432 | 432 |
else: |
433 | 433 |
offline = None |
434 |
|
|
435 |
if opts.drained is not None: |
|
436 |
drained = opts.drained == 'yes' |
|
437 |
else: |
|
438 |
drained = None |
|
434 | 439 |
op = opcodes.OpSetNodeParams(node_name=args[0], |
435 | 440 |
master_candidate=candidate, |
436 | 441 |
offline=offline, |
442 |
drained=drained, |
|
437 | 443 |
force=opts.force) |
438 | 444 |
|
439 | 445 |
# even if here we process the result, we allow submit only |
... | ... | |
515 | 521 |
make_option("-O", "--offline", dest="offline", |
516 | 522 |
choices=('yes', 'no'), default=None, |
517 | 523 |
help="Set the offline flag on the node"), |
524 |
make_option("-D", "--drained", dest="drained", |
|
525 |
choices=('yes', 'no'), default=None, |
|
526 |
help="Set the drained flag on the node"), |
|
518 | 527 |
], |
519 | 528 |
"<instance>", "Alters the parameters of an instance"), |
520 | 529 |
'remove': (RemoveNode, ARGS_ONE, [DEBUG_OPT], |
Also available in: Unified diff