Revision 83120a01 lib/cmdlib.py

b/lib/cmdlib.py
165 165

  
166 166

  
167 167
def _GetWantedNodes(lu, nodes):
168
  """Returns list of checked and expanded nodes.
169

  
170
  Args:
171
    nodes: List of nodes (strings) or None for all
172

  
173
  """
168 174
  if nodes is not None and not isinstance(nodes, list):
169 175
    raise errors.OpPrereqError, "Invalid argument type 'nodes'"
170 176

  
......
183 189

  
184 190

  
185 191
def _CheckOutputFields(static, dynamic, selected):
186
    static_fields = frozenset(static)
187
    dynamic_fields = frozenset(dynamic)
192
  """Checks whether all selected fields are valid.
193

  
194
  Args:
195
    static: Static fields
196
    dynamic: Dynamic fields
197

  
198
  """
199
  static_fields = frozenset(static)
200
  dynamic_fields = frozenset(dynamic)
188 201

  
189
    all_fields = static_fields | dynamic_fields
202
  all_fields = static_fields | dynamic_fields
190 203

  
191
    if not all_fields.issuperset(selected):
192
      raise errors.OpPrereqError, ("Unknown output fields selected: %s"
193
                                   % ",".join(frozenset(selected).
194
                                              difference(all_fields)))
204
  if not all_fields.issuperset(selected):
205
    raise errors.OpPrereqError, ("Unknown output fields selected: %s"
206
                                 % ",".join(frozenset(selected).
207
                                            difference(all_fields)))
195 208

  
196 209

  
197 210
def _UpdateEtcHosts(fullnode, ip):

Also available in: Unified diff