Revision fe482621
b/lib/cmdlib.py | ||
---|---|---|
2011 | 2011 |
force = self.op.force |
2012 | 2012 |
extra_args = getattr(self.op, "extra_args", "") |
2013 | 2013 |
|
2014 |
self.cfg.MarkInstanceUp(instance.name) |
|
2015 |
|
|
2014 | 2016 |
node_current = instance.primary_node |
2015 | 2017 |
|
2016 | 2018 |
_StartInstanceDisks(self.cfg, instance, force) |
... | ... | |
2019 | 2021 |
_ShutdownInstanceDisks(instance, self.cfg) |
2020 | 2022 |
raise errors.OpExecError("Could not start instance") |
2021 | 2023 |
|
2022 |
self.cfg.MarkInstanceUp(instance.name) |
|
2023 |
|
|
2024 | 2024 |
|
2025 | 2025 |
class LURebootInstance(LogicalUnit): |
2026 | 2026 |
"""Reboot an instance. |
... | ... | |
2136 | 2136 |
""" |
2137 | 2137 |
instance = self.instance |
2138 | 2138 |
node_current = instance.primary_node |
2139 |
self.cfg.MarkInstanceDown(instance.name) |
|
2139 | 2140 |
if not rpc.call_instance_shutdown(node_current, instance): |
2140 | 2141 |
logger.Error("could not shutdown instance") |
2141 | 2142 |
|
2142 |
self.cfg.MarkInstanceDown(instance.name) |
|
2143 | 2143 |
_ShutdownInstanceDisks(instance, self.cfg) |
2144 | 2144 |
|
2145 | 2145 |
|
b/lib/mcpu.py | ||
---|---|---|
125 | 125 |
lu.CheckPrereq() |
126 | 126 |
hm = HooksMaster(rpc.call_hooks_runner, self, lu) |
127 | 127 |
hm.RunPhase(constants.HOOKS_PHASE_PRE) |
128 |
result = lu.Exec(self._feedback_fn) |
|
129 |
hm.RunPhase(constants.HOOKS_PHASE_POST) |
|
130 |
if lu.cfg is not None: |
|
131 |
# we use lu.cfg and not self.cfg as for init cluster, self.cfg |
|
132 |
# is None but lu.cfg has been recently initialized in the |
|
133 |
# lu.Exec method |
|
134 |
if write_count != lu.cfg.write_count: |
|
135 |
hm.RunConfigUpdate() |
|
128 |
try: |
|
129 |
result = lu.Exec(self._feedback_fn) |
|
130 |
hm.RunPhase(constants.HOOKS_PHASE_POST) |
|
131 |
finally: |
|
132 |
if lu.cfg is not None: |
|
133 |
# we use lu.cfg and not self.cfg as for init cluster, self.cfg |
|
134 |
# is None but lu.cfg has been recently initialized in the |
|
135 |
# lu.Exec method |
|
136 |
if write_count != lu.cfg.write_count: |
|
137 |
hm.RunConfigUpdate() |
|
136 | 138 |
|
137 | 139 |
return result |
138 | 140 |
|
Also available in: Unified diff