Revision b423c513 lib/mcpu.py
b/lib/mcpu.py | ||
---|---|---|
428 | 428 |
self.lu = lu |
429 | 429 |
self.op = lu.op |
430 | 430 |
self.pre_env = None |
431 |
self.pre_nodes = None
|
|
431 |
self.post_nodes = None
|
|
432 | 432 |
|
433 | 433 |
def _BuildEnv(self, phase): |
434 | 434 |
"""Compute the environment and the target nodes. |
... | ... | |
526 | 526 |
(env, node_list_pre, node_list_post) = self._BuildEnv(phase) |
527 | 527 |
if nodes is None: |
528 | 528 |
if phase == constants.HOOKS_PHASE_PRE: |
529 |
self.pre_nodes = (node_list_pre, node_list_post) |
|
530 | 529 |
nodes = node_list_pre |
530 |
self.post_nodes = node_list_post |
|
531 |
elif self.post_nodes is None: |
|
532 |
raise AssertionError("Pre-phase must be run before post-phase") |
|
531 | 533 |
elif phase == constants.HOOKS_PHASE_POST: |
532 |
post_nodes = (node_list_pre, node_list_post) |
|
533 |
assert self.pre_nodes == post_nodes, \ |
|
534 |
("Node lists returned for post-phase hook don't match pre-phase" |
|
535 |
" lists (pre %s, post %s)" % (self.pre_nodes, post_nodes)) |
|
536 |
nodes = node_list_post |
|
534 |
nodes = self.post_nodes |
|
537 | 535 |
else: |
538 | 536 |
raise AssertionError("Unknown phase '%s'" % phase) |
539 | 537 |
|
Also available in: Unified diff