Commit 4c4b5058 authored by Iustin Pop's avatar Iustin Pop

Fix two bugs in seldom-used codepaths

New version of pylint, new bugs found!
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarOlivier Tharan <olive@google.com>
parent 80f3f415
......@@ -5218,7 +5218,8 @@ class LUReplaceDisks(LogicalUnit):
if len(ial.nodes) != ial.required_nodes:
raise errors.OpPrereqError("iallocator '%s' returned invalid number"
" of nodes (%s), required %s" %
(len(ial.nodes), ial.required_nodes))
(self.op.iallocator,
len(ial.nodes), ial.required_nodes))
self.op.remote_node = ial.nodes[0]
self.LogInfo("Selected new secondary for the instance: %s",
self.op.remote_node)
......
......@@ -68,7 +68,7 @@ class FakeHypervisor(hv_base.BaseHypervisor):
try:
inst_id = fh.readline().strip()
memory = utils.TryConvert(int, fh.readline().strip())
vcpus = utils.TryConvert(fh.readline().strip())
vcpus = utils.TryConvert(int, fh.readline().strip())
stat = "---b-"
times = "0"
return (instance_name, inst_id, memory, vcpus, stat, times)
......
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