Commit 92c1b5d6 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix cluster verify with simulate-errors

In simulate errors mode, the test "ntime_diff is not None" will be
ignored, and thus a None value will try to be formatted as %.01f. We
workaround this by formatting it before, and then only using %s, which
can format a 'None' value.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent 1feb39ec
......@@ -1460,14 +1460,14 @@ class LUVerifyCluster(LogicalUnit):
_ErrorIf(True, self.ENODETIME, node, "Node returned invalid time")
if ntime_merged < (nvinfo_starttime - constants.NODE_MAX_CLOCK_SKEW):
ntime_diff = abs(nvinfo_starttime - ntime_merged)
ntime_diff = "%.01fs" % abs(nvinfo_starttime - ntime_merged)
elif ntime_merged > (nvinfo_endtime + constants.NODE_MAX_CLOCK_SKEW):
ntime_diff = abs(ntime_merged - nvinfo_endtime)
ntime_diff = "%.01fs" % abs(ntime_merged - nvinfo_endtime)
ntime_diff = None
_ErrorIf(ntime_diff is not None, self.ENODETIME, node,
"Node time diverges by at least %0.1fs from master node time",
"Node time diverges by at least %s from master node time",
if ntime_diff is not None:
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