Revision 2395c322 lib/mcpu.py
b/lib/mcpu.py | ||
---|---|---|
122 | 122 |
write_count = 0 |
123 | 123 |
lu = lu_class(self, op, self.cfg, self.sstore) |
124 | 124 |
lu.CheckPrereq() |
125 |
hm = HooksMaster(rpc.call_hooks_runner, lu) |
|
125 |
hm = HooksMaster(rpc.call_hooks_runner, self, lu)
|
|
126 | 126 |
hm.RunPhase(constants.HOOKS_PHASE_PRE) |
127 | 127 |
result = lu.Exec(self._feedback_fn) |
128 | 128 |
hm.RunPhase(constants.HOOKS_PHASE_POST) |
... | ... | |
159 | 159 |
lu = lu_class(self, op, self.cfg, self.sstore) |
160 | 160 |
lu.CheckPrereq() |
161 | 161 |
#if do_hooks: |
162 |
# hm = HooksMaster(rpc.call_hooks_runner, lu) |
|
162 |
# hm = HooksMaster(rpc.call_hooks_runner, self, lu)
|
|
163 | 163 |
# hm.RunPhase(constants.HOOKS_PHASE_PRE) |
164 | 164 |
result = lu.Exec(self._feedback_fn) |
165 | 165 |
#if do_hooks: |
... | ... | |
202 | 202 |
which behaves the same works. |
203 | 203 |
|
204 | 204 |
""" |
205 |
def __init__(self, callfn, lu): |
|
205 |
def __init__(self, callfn, proc, lu):
|
|
206 | 206 |
self.callfn = callfn |
207 |
self.proc = proc |
|
207 | 208 |
self.lu = lu |
208 | 209 |
self.op = lu.op |
209 | 210 |
self.env, node_list_pre, node_list_post = self._BuildEnv() |
... | ... | |
272 | 273 |
for node_name in results: |
273 | 274 |
res = results[node_name] |
274 | 275 |
if res is False or not isinstance(res, list): |
275 |
raise errors.HooksFailure("Communication failure to node %s" %
|
|
276 |
node_name)
|
|
276 |
self.proc.LogWarning("Communication failure to node %s" % node_name)
|
|
277 |
continue
|
|
277 | 278 |
for script, hkr, output in res: |
278 | 279 |
if hkr == constants.HKR_FAIL: |
279 | 280 |
output = output.strip().encode("string_escape") |
Also available in: Unified diff