Commit add6d208 authored by Iustin Pop's avatar Iustin Pop
Browse files

Prevent onlining a node without working noded

This is just a basic check, plus a warning. In the future, we might do
more checks, or prevent simple onlining (without readd) if --force is
not passed.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 4ca52046
......@@ -4108,6 +4108,19 @@ class LUSetNodeParams(LogicalUnit):
self.new_role = new_role
if old_role == self._ROLE_OFFLINE and new_role != old_role:
# Trying to transition out of offline status
result = self.rpc.call_version([])[]
if result.fail_msg:
raise errors.OpPrereqError("Node %s is being de-offlined but fails"
" to report its version: %s" %
(, result.fail_msg),
self.LogWarning("Transitioning node from offline to online state"
" without using re-add. Please make sure the node"
" is healthy!")
def Exec(self, feedback_fn):
"""Modifies a node.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment