Revision beff3779
b/lib/cmdlib.py | ||
---|---|---|
3249 | 3249 |
self.nodes = [] |
3250 | 3250 |
self.master_node = self.cfg.GetMasterNode() |
3251 | 3251 |
|
3252 |
assert self.op.power_delay >= 0.0 |
|
3253 |
|
|
3252 | 3254 |
if self.op.node_names: |
3253 | 3255 |
if self.op.command in self._SKIP_MASTER: |
3254 | 3256 |
if self.master_node in self.op.node_names: |
... | ... | |
3312 | 3314 |
master_node = self.master_node |
3313 | 3315 |
ret = [] |
3314 | 3316 |
|
3315 |
for node in self.nodes:
|
|
3317 |
for idx, node in enumerate(self.nodes):
|
|
3316 | 3318 |
node_entry = [(constants.RS_NORMAL, node.name)] |
3317 | 3319 |
ret.append(node_entry) |
3318 | 3320 |
|
... | ... | |
3366 | 3368 |
|
3367 | 3369 |
node_entry.append((constants.RS_NORMAL, result.payload)) |
3368 | 3370 |
|
3371 |
if (self.op.command == constants.OOB_POWER_ON and |
|
3372 |
idx < len(self.nodes) - 1): |
|
3373 |
time.sleep(self.op.power_delay) |
|
3374 |
|
|
3369 | 3375 |
return ret |
3370 | 3376 |
|
3371 | 3377 |
def _CheckPayload(self, result): |
b/lib/constants.py | ||
---|---|---|
702 | 702 |
OOB_POWER_STATUS_POWERED = "powered" |
703 | 703 |
|
704 | 704 |
OOB_TIMEOUT = 60 # 60 seconds |
705 |
OOB_POWER_DELAY = 2.0 # 2 seconds |
|
705 | 706 |
|
706 | 707 |
OOB_STATUS_OK = "OK" |
707 | 708 |
OOB_STATUS_WARNING = "WARNING" |
b/lib/ht.py | ||
---|---|---|
267 | 267 |
TStrictPositiveInt = \ |
268 | 268 |
TAnd(TInt, WithDesc("GreaterThanZero")(lambda v: v > 0)) |
269 | 269 |
|
270 |
#: a positive float |
|
271 |
TPositiveFloat = \ |
|
272 |
TAnd(TFloat, WithDesc("EqualGreaterZero")(lambda v: v >= 0.0)) |
|
273 |
|
|
270 | 274 |
|
271 | 275 |
def TListOf(my_type): |
272 | 276 |
"""Checks if a given value is a list with all elements of the same type. |
b/lib/opcodes.py | ||
---|---|---|
678 | 678 |
"Timeout before the OOB helper will be terminated"), |
679 | 679 |
("ignore_status", False, ht.TBool, |
680 | 680 |
"Ignores the node offline status for power off"), |
681 |
("power_delay", constants.OOB_POWER_DELAY, ht.TPositiveFloat, |
|
682 |
"Time in seconds to wait between powering on nodes"), |
|
681 | 683 |
] |
682 | 684 |
|
683 | 685 |
|
Also available in: Unified diff