master daemon: allow skipping the voting process
[ganeti-local] / scripts / gnt-os
index 642545e..a0c09a7 100755 (executable)
 # 02110-1301, USA.
 
 
+# pylint: disable-msg=W0401,W0614
+# W0401: Wildcard import ganeti.cli
+# W0614: Unused import %s from wildcard import (since we need cli)
+
 import sys
 from optparse import make_option
 
 from ganeti.cli import *
 from ganeti import opcodes
-from ganeti import objects
 from ganeti import utils
-from ganeti import errors
 from ganeti import constants
 
 
 def ListOS(opts, args):
-  """List the OSes existing on this node.
+  """List the valid OSes in the cluster.
+
+  @param opts: the command line options selected by the user
+  @type args: list
+  @param args: should be an empty list
+  @rtype: int
+  @return: the desired exit code
 
   """
   op = opcodes.OpDiagnoseOS(output_fields=["name", "valid"], names=[])
@@ -47,7 +55,8 @@ def ListOS(opts, args):
     headers = None
 
   data = GenerateTable(separator=None, headers=headers, fields=["name"],
-                       data=[[row[0]] for row in result if row[1]])
+                       data=[[row[0]] for row in result if row[1]],
+                       units=None)
 
   for line in data:
     ToStdout(line)
@@ -58,6 +67,12 @@ def ListOS(opts, args):
 def DiagnoseOS(opts, args):
   """Analyse all OSes on this cluster.
 
+  @param opts: the command line options selected by the user
+  @type args: list
+  @param args: should be an empty list
+  @rtype: int
+  @return: the desired exit code
+
   """
   op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "node_status"],
                             names=[])