Commit 05325a35 authored by Bernardo Dal Seno's avatar Bernardo Dal Seno
Browse files

Fixes and improvements to comments



Some fixes, added more information in a few points, removed a stale (5+
year old) TODO comment.
Signed-off-by: default avatarBernardo Dal Seno <bdalseno@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent c96887cf
......@@ -6788,9 +6788,9 @@ def _ShutdownInstanceDisks(lu, instance, disks=None, ignore_primary=False):
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
This function checks if a given node has the needed amount of free
memory. In case the node has less memory or we cannot get the
information from the node, this function raise an OpPrereqError
information from the node, this function raises an OpPrereqError
exception.
 
@type lu: C{LogicalUnit}
......@@ -6828,11 +6828,11 @@ def _CheckNodeFreeMemory(lu, node, reason, requested, hypervisor_name):
 
 
def _CheckNodesFreeDiskPerVG(lu, nodenames, req_sizes):
"""Checks if nodes have enough free disk space in the all VGs.
"""Checks if nodes have enough free disk space in all the VGs.
 
This function check if all given nodes have the needed amount of
This function checks if all given nodes have the needed amount of
free disk. In case any node has less disk or we cannot get the
information from the node, this function raise an OpPrereqError
information from the node, this function raises an OpPrereqError
exception.
 
@type lu: C{LogicalUnit}
......@@ -6853,9 +6853,9 @@ def _CheckNodesFreeDiskPerVG(lu, nodenames, req_sizes):
def _CheckNodesFreeDiskOnVG(lu, nodenames, vg, requested):
"""Checks if nodes have enough free disk space in the specified VG.
 
This function check if all given nodes have the needed amount of
This function checks if all given nodes have the needed amount of
free disk. In case any node has less disk or we cannot get the
information from the node, this function raise an OpPrereqError
information from the node, this function raises an OpPrereqError
exception.
 
@type lu: C{LogicalUnit}
......@@ -9137,8 +9137,6 @@ def _GenerateDiskTemplate(
"""Generate the entire disk layout for a given template type.
 
"""
#TODO: compute space requirements
vgname = lu.cfg.GetVGName()
disk_count = len(disk_info)
disks = []
......
......@@ -1023,7 +1023,7 @@ class Instance(TaggableObject):
return tuple(all_nodes)
secondary_nodes = property(_ComputeSecondaryNodes, None, None,
"List of secondary nodes")
"List of names of secondary nodes")
def _ComputeAllNodes(self):
"""Compute the list of all nodes.
......@@ -1051,7 +1051,7 @@ class Instance(TaggableObject):
return tuple(all_nodes)
all_nodes = property(_ComputeAllNodes, None, None,
"List of all nodes of the instance")
"List of names of all the nodes of the instance")
def MapLVsByNode(self, lvmap=None, devs=None, node=None):
"""Provide a mapping of nodes to LVs this instance owns.
......
......@@ -150,7 +150,7 @@ class RpcResult(object):
"""RPC Result class.
This class holds an RPC result. It is needed since in multi-node
calls we can't raise an exception just because one one out of many
calls we can't raise an exception just because one out of many
failed, and therefore we use this class to encapsulate the result.
@ivar data: the data payload, for successful results, or None
......@@ -405,6 +405,8 @@ class _RpcProcessor:
@param body: dictionary with request bodies per host
@type read_timeout: int or None
@param read_timeout: Read timeout for request
@rtype: dictionary
@return: a dictionary mapping host names to rpc.RpcResult objects
"""
assert read_timeout is not None, \
......
......@@ -166,6 +166,8 @@ def AssertCommand(cmd, fail=False, node=None):
@param node: if passed, it should be the node on which the command
should be executed, instead of the master node (can be either a
dict or a string)
@return: the return code of the command
@raise qa_error.Error: if the command fails when it shouldn't or vice versa
"""
if node is 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