Commit 83120a01 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add description, fix indentation.

Reviewed-by: iustinp
parent 588d1da3
...@@ -165,6 +165,12 @@ class NoHooksLU(LogicalUnit): ...@@ -165,6 +165,12 @@ class NoHooksLU(LogicalUnit):
def _GetWantedNodes(lu, nodes): def _GetWantedNodes(lu, nodes):
"""Returns list of checked and expanded nodes.
Args:
nodes: List of nodes (strings) or None for all
"""
if nodes is not None and not isinstance(nodes, list): if nodes is not None and not isinstance(nodes, list):
raise errors.OpPrereqError, "Invalid argument type 'nodes'" raise errors.OpPrereqError, "Invalid argument type 'nodes'"
...@@ -183,15 +189,22 @@ def _GetWantedNodes(lu, nodes): ...@@ -183,15 +189,22 @@ def _GetWantedNodes(lu, nodes):
def _CheckOutputFields(static, dynamic, selected): def _CheckOutputFields(static, dynamic, selected):
static_fields = frozenset(static) """Checks whether all selected fields are valid.
dynamic_fields = frozenset(dynamic)
Args:
static: Static fields
dynamic: Dynamic fields
"""
static_fields = frozenset(static)
dynamic_fields = frozenset(dynamic)
all_fields = static_fields | dynamic_fields all_fields = static_fields | dynamic_fields
if not all_fields.issuperset(selected): if not all_fields.issuperset(selected):
raise errors.OpPrereqError, ("Unknown output fields selected: %s" raise errors.OpPrereqError, ("Unknown output fields selected: %s"
% ",".join(frozenset(selected). % ",".join(frozenset(selected).
difference(all_fields))) difference(all_fields)))
def _UpdateEtcHosts(fullnode, ip): def _UpdateEtcHosts(fullnode, ip):
......
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