Commit 9ca87a96 authored by Iustin Pop's avatar Iustin Pop
Browse files

cleanup: do not hide upper-scope name

hypervisor is a module, so we shouldn't use it as an argument.

Reviewed-by: amishchenko
parent 43017d26
......@@ -2504,7 +2504,7 @@ def _ShutdownInstanceDisks(lu, instance, ignore_primary=False):
return result
def _CheckNodeFreeMemory(lu, node, reason, requested, hypervisor):
def _CheckNodeFreeMemory(lu, node, reason, requested, hypervisor_name):
"""Checks if a node has enough free memory.
This function check if a given node has the needed amount of free
......@@ -2520,13 +2520,13 @@ def _CheckNodeFreeMemory(lu, node, reason, requested, hypervisor):
@param reason: string to use in the error message
@type requested: C{int}
@param requested: the amount of memory in MiB to check for
@type hypervisor: C{str}
@param hypervisor: the hypervisor to ask for memory stats
@type hypervisor_name: C{str}
@param hypervisor_name: the hypervisor to ask for memory stats
@raise errors.OpPrereqError: if the node doesn't have enough memory, or
we cannot check the node
"""
nodeinfo = lu.rpc.call_node_info([node], lu.cfg.GetVGName(), hypervisor)
nodeinfo = lu.rpc.call_node_info([node], lu.cfg.GetVGName(), hypervisor_name)
nodeinfo[node].Raise()
free_mem = nodeinfo[node].data.get('memory_free')
if not isinstance(free_mem, int):
......
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