Revision f97a6b10 lib/mcpu.py
b/lib/mcpu.py | ||
---|---|---|
116 | 116 |
lu.CheckPrereq() |
117 | 117 |
do_hooks = lu_class.HPATH is not None |
118 | 118 |
if do_hooks: |
119 |
hm = HooksMaster(rpc.call_hooks_runner, self.cfg, self.sstore, lu)
|
|
119 |
hm = HooksMaster(rpc.call_hooks_runner, lu) |
|
120 | 120 |
hm.RunPhase(constants.HOOKS_PHASE_PRE) |
121 | 121 |
result = lu.Exec(feedback_fn) |
122 | 122 |
if do_hooks: |
... | ... | |
145 | 145 |
if lu_class.REQ_CLUSTER and self.cfg is None: |
146 | 146 |
self.cfg = config.ConfigWriter() |
147 | 147 |
self.sstore = ssconf.SimpleStore() |
148 |
do_hooks = lu_class.HPATH is not None |
|
148 |
#do_hooks = lu_class.HPATH is not None
|
|
149 | 149 |
lu = lu_class(self, op, self.cfg, self.sstore) |
150 | 150 |
lu.CheckPrereq() |
151 | 151 |
#if do_hooks: |
152 |
# hm = HooksMaster(rpc.call_hooks_runner, self.cfg, self.sstore, lu)
|
|
152 |
# hm = HooksMaster(rpc.call_hooks_runner, lu) |
|
153 | 153 |
# hm.RunPhase(constants.HOOKS_PHASE_PRE) |
154 | 154 |
result = lu.Exec(feedback_fn) |
155 | 155 |
#if do_hooks: |
... | ... | |
169 | 169 |
which behaves the same works. |
170 | 170 |
|
171 | 171 |
""" |
172 |
def __init__(self, callfn, cfg, sstore, lu):
|
|
172 |
def __init__(self, callfn, lu): |
|
173 | 173 |
self.callfn = callfn |
174 |
self.cfg = cfg |
|
175 |
self.sstore = sstore |
|
176 | 174 |
self.lu = lu |
177 | 175 |
self.op = lu.op |
178 | 176 |
self.hpath = self.lu.HPATH |
... | ... | |
200 | 198 |
for key in lu_env: |
201 | 199 |
env["GANETI_" + key] = lu_env[key] |
202 | 200 |
|
203 |
if self.sstore is not None: |
|
204 |
env["GANETI_CLUSTER"] = self.sstore.GetClusterName() |
|
205 |
env["GANETI_MASTER"] = self.sstore.GetMasterNode() |
|
201 |
if self.lu.sstore is not None:
|
|
202 |
env["GANETI_CLUSTER"] = self.lu.sstore.GetClusterName()
|
|
203 |
env["GANETI_MASTER"] = self.lu.sstore.GetMasterNode()
|
|
206 | 204 |
|
207 | 205 |
for key in env: |
208 | 206 |
if not isinstance(env[key], str): |
Also available in: Unified diff