Document that OpTestDelay/TestDelay take duration in seconds
authorDato Simó <dato@google.com>
Wed, 23 Jan 2013 19:33:53 +0000 (19:33 +0000)
committerDato Simó <dato@google.com>
Wed, 30 Jan 2013 17:39:44 +0000 (17:39 +0000)
Also, fix @rtype and @return elements of utils.TestDelay(), which now
returns a tuple but this wasn't being indicated.

Signed-off-by: Dato Simó <dato@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>

lib/opcodes.py
lib/utils/wrapper.py

index e533310..7d67282 100644 (file)
@@ -1959,7 +1959,7 @@ class OpTestDelay(OpCode):
   This is used just for debugging and testing.
 
   Parameters:
-    - duration: the time to sleep
+    - duration: the time to sleep, in seconds
     - on_master: if true, sleep on the master
     - on_nodes: list of nodes in which to sleep
 
index 3b6f6f3..7c98c6f 100644 (file)
@@ -37,9 +37,10 @@ def TestDelay(duration):
   """Sleep for a fixed amount of time.
 
   @type duration: float
-  @param duration: the sleep duration
-  @rtype: boolean
-  @return: False for negative value, True otherwise
+  @param duration: the sleep duration, in seconds
+  @rtype: (boolean, str)
+  @return: False for negative value, and an accompanying error message;
+      True otherwise (and msg is None)
 
   """
   if duration < 0: