opcodes.OpRenameCluster: cmdlib.LURenameCluster,
opcodes.OpVerifyDisks: cmdlib.LUVerifyDisks,
opcodes.OpSetClusterParams: cmdlib.LUSetClusterParams,
+ opcodes.OpRedistributeConfig: cmdlib.LURedistributeConfig,
# node lu
opcodes.OpAddNode: cmdlib.LUAddNode,
opcodes.OpQueryNodes: cmdlib.LUQueryNodes,
opcodes.OpQueryNodeVolumes: cmdlib.LUQueryNodeVolumes,
opcodes.OpRemoveNode: cmdlib.LURemoveNode,
opcodes.OpSetNodeParams: cmdlib.LUSetNodeParams,
+ opcodes.OpPowercycleNode: cmdlib.LUPowercycleNode,
# instance lu
opcodes.OpCreateInstance: cmdlib.LUCreateInstance,
opcodes.OpReinstallInstance: cmdlib.LUReinstallInstance,
opcodes.OpDeactivateInstanceDisks: cmdlib.LUDeactivateInstanceDisks,
opcodes.OpReplaceDisks: cmdlib.LUReplaceDisks,
opcodes.OpFailoverInstance: cmdlib.LUFailoverInstance,
+ opcodes.OpMigrateInstance: cmdlib.LUMigrateInstance,
opcodes.OpConnectConsole: cmdlib.LUConnectConsole,
opcodes.OpQueryInstances: cmdlib.LUQueryInstances,
opcodes.OpQueryInstanceData: cmdlib.LUQueryInstanceData,
h_results = hm.RunPhase(constants.HOOKS_PHASE_PRE)
lu.HooksCallBack(constants.HOOKS_PHASE_PRE, h_results,
self._feedback_fn, None)
+
+ if getattr(lu.op, "dry_run", False):
+ # in this mode, no post-hooks are run, and the config is not
+ # written (as it might have been modified by another LU, and we
+ # shouldn't do writeout on behalf of other threads
+ self.LogInfo("dry-run mode requested, not actually executing"
+ " the operation")
+ return lu.dry_run_result
+
try:
result = lu.Exec(self._feedback_fn)
h_results = hm.RunPhase(constants.HOOKS_PHASE_POST)
raise errors.HooksFailure("Communication failure")
for node_name in results:
res = results[node_name]
- if res.failed or res.data is False or not isinstance(res.data, list):
- if not res.offline:
- self.proc.LogWarning("Communication failure to node %s" %
- node_name)
+ if res.offline:
+ continue
+ msg = res.RemoteFailMsg()
+ if msg:
+ self.proc.LogWarning("Communication failure to node %s: %s",
+ node_name, msg)
continue
- for script, hkr, output in res.data:
+ for script, hkr, output in res.payload:
if hkr == constants.HKR_FAIL:
- output = output.strip().encode("string_escape")
errs.append((node_name, script, output))
if errs:
raise errors.HooksAbort(errs)
phase = constants.HOOKS_PHASE_POST
hpath = constants.HOOKS_NAME_CFGUPDATE
nodes = [self.lu.cfg.GetMasterNode()]
- results = self._RunWrapper(nodes, hpath, phase)
+ self._RunWrapper(nodes, hpath, phase)