From 6099bfcf18de1114bc825fefc447e4b49d1c937f Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Mon, 27 Oct 2008 23:20:10 +0000 Subject: [PATCH] Documentation updates for gnt-debug and gnt-os Reviewed-by: imsnah --- scripts/gnt-debug | 27 +++++++++++++++++++++++++-- scripts/gnt-os | 14 +++++++++++++- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/scripts/gnt-debug b/scripts/gnt-debug index ed2d476e1..7feefe98b 100755 --- a/scripts/gnt-debug +++ b/scripts/gnt-debug @@ -39,6 +39,13 @@ from ganeti import errors def Delay(opts, args): """Sleeps for a while + @param opts: the command line options selected by the user + @type args: list + @param args: should contain only one element, the duration + the sleep + @rtype: int + @return: the desired exit code + """ delay = float(args[0]) op = opcodes.OpTestDelay(duration=delay, @@ -50,7 +57,16 @@ def Delay(opts, args): def GenericOpCodes(opts, args): - """Send any opcode to the master + """Send any opcode to the master. + + @todo: The function is broken and needs to be converted to the + current job queue API + @param opts: the command line options selected by the user + @type args: list + @param args: should contain only one element, the path of + the file with the opcode definition + @rtype: int + @return: the desired exit code """ fname = args[0] @@ -96,8 +112,15 @@ def GenericOpCodes(opts, args): def TestAllocator(opts, args): - """Runs the test allocator opcode""" + """Runs the test allocator opcode. + @param opts: the command line options selected by the user + @type args: list + @param args: should contain only one element, the iallocator name + @rtype: int + @return: the desired exit code + + """ try: disks = [{"size": utils.ParseUnit(val), "mode": 'w'} for val in opts.disks.split(",")] diff --git a/scripts/gnt-os b/scripts/gnt-os index 265a97d10..48c8336cf 100755 --- a/scripts/gnt-os +++ b/scripts/gnt-os @@ -33,7 +33,13 @@ 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=[]) @@ -60,6 +66,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=[]) -- GitLab