Revision 8c4b9364
b/lib/mcpu.py | ||
---|---|---|
357 | 357 |
results = self._RunWrapper(nodes, hpath, phase) |
358 | 358 |
else: |
359 | 359 |
results = self._RunWrapper(self.node_list[phase], hpath, phase) |
360 |
if phase == constants.HOOKS_PHASE_PRE: |
|
361 |
errs = [] |
|
362 |
if not results: |
|
363 |
raise errors.HooksFailure("Communication failure") |
|
364 |
for node_name in results: |
|
365 |
res = results[node_name] |
|
366 |
if res.offline: |
|
367 |
continue |
|
368 |
msg = res.RemoteFailMsg() |
|
369 |
if msg: |
|
370 |
self.lu.LogWarning("Communication failure to node %s: %s", |
|
371 |
node_name, msg) |
|
372 |
continue |
|
373 |
for script, hkr, output in res.payload: |
|
374 |
if hkr == constants.HKR_FAIL: |
|
360 |
errs = [] |
|
361 |
if not results: |
|
362 |
msg = "Communication Failure" |
|
363 |
if phase == constants.HOOKS_PHASE_PRE: |
|
364 |
raise errors.HooksFailure(msg) |
|
365 |
else: |
|
366 |
self.lu.LogWarning(msg) |
|
367 |
for node_name in results: |
|
368 |
res = results[node_name] |
|
369 |
if res.offline: |
|
370 |
continue |
|
371 |
msg = res.RemoteFailMsg() |
|
372 |
if msg: |
|
373 |
self.lu.LogWarning("Communication failure to node %s: %s", |
|
374 |
node_name, msg) |
|
375 |
continue |
|
376 |
for script, hkr, output in res.payload: |
|
377 |
if hkr == constants.HKR_FAIL: |
|
378 |
if phase == constants.HOOKS_PHASE_PRE: |
|
375 | 379 |
errs.append((node_name, script, output)) |
376 |
if errs: |
|
377 |
raise errors.HooksAbort(errs) |
|
380 |
else: |
|
381 |
if not output: |
|
382 |
output = "(no output)" |
|
383 |
self.lu.LogWarning("On %s script %s failed, output: %s" % |
|
384 |
(node_name, script, output)) |
|
385 |
if errs and phase == constants.HOOKS_PHASE_PRE: |
|
386 |
raise errors.HooksAbort(errs) |
|
378 | 387 |
return results |
379 | 388 |
|
380 | 389 |
def RunConfigUpdate(self): |
Also available in: Unified diff