Revision ebc75510 lib/mcpu.py
b/lib/mcpu.py | ||
---|---|---|
39 | 39 |
from ganeti import cmdlib |
40 | 40 |
from ganeti import locking |
41 | 41 |
from ganeti import utils |
42 |
from ganeti import compat |
|
42 | 43 |
|
43 | 44 |
|
44 | 45 |
_OP_PREFIX = "Op" |
... | ... | |
448 | 449 |
} |
449 | 450 |
|
450 | 451 |
if self.lu.HPATH is not None: |
451 |
lu_env, lu_nodes_pre, lu_nodes_post = self.lu.BuildHooksEnv()
|
|
452 |
(lu_env, lu_nodes_pre, lu_nodes_post) = self.lu.BuildHooksEnv()
|
|
452 | 453 |
if lu_env: |
453 |
for key in lu_env: |
|
454 |
env["GANETI_" + key] = lu_env[key] |
|
454 |
assert not compat.any(key.upper().startswith("GANETI") |
|
455 |
for key in lu_env) |
|
456 |
env.update(("GANETI_%s" % key, value) for (key, value) in lu_env) |
|
455 | 457 |
else: |
456 | 458 |
lu_nodes_pre = lu_nodes_post = [] |
457 | 459 |
|
... | ... | |
472 | 474 |
|
473 | 475 |
env = dict([(str(key), str(val)) for key, val in env.iteritems()]) |
474 | 476 |
|
477 |
assert compat.all(key == key.upper() and |
|
478 |
(key == "PATH" or key.startswith("GANETI_")) |
|
479 |
for key in env) |
|
480 |
|
|
475 | 481 |
return self.callfn(node_list, hpath, phase, env) |
476 | 482 |
|
477 | 483 |
def RunPhase(self, phase, nodes=None): |
Also available in: Unified diff