[Pkg-ganeti-devel] [ganeti] 14/165: Add documentation for return values of PollJob call stack

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Tue Aug 11 13:53:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch master
in repository ganeti.

commit ae254087d1f33c0da51ac88480a305ca14d32ea2
Author: Aaron Karper <akarper at google.com>
Date:   Mon Oct 27 16:37:44 2014 +0100

    Add documentation for return values of PollJob call stack
    
    1. ganeti.cli.GenericPollJob
    2. ganeti.rapi.client_utils.PollJob
    3. tools/move-instance.MoveRuntime.PollJob
    
    didn't have documentation for the return values or the error conditions.
    Unfortunately the return type depends on the job watched, but this way
    the doc informs about the meaning at least.
    
    Signed-off-by: Aaron Karper <akarper at google.com>
    Reviewed-by: Hrvoje Ribicic <riba at google.com>
---
 lib/cli.py               | 4 ++++
 lib/rapi/client_utils.py | 6 ++++++
 tools/move-instance      | 6 ++++++
 3 files changed, 16 insertions(+)

diff --git a/lib/cli.py b/lib/cli.py
index 8cd4210..3d1faeb 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -714,6 +714,10 @@ def GenericPollJob(job_id, cbs, report_cbs):
   @type report_cbs: Instance of L{JobPollReportCbBase}
   @param report_cbs: Reporting callbacks
 
+  @return: the opresult of the job
+  @raise errors.JobLost: If job can't be found
+  @raise errors.OpExecError: If job didn't succeed
+
   """
   prev_job_info = None
   prev_logmsg_serial = None
diff --git a/lib/rapi/client_utils.py b/lib/rapi/client_utils.py
index 231d277..224e1a2 100644
--- a/lib/rapi/client_utils.py
+++ b/lib/rapi/client_utils.py
@@ -103,5 +103,11 @@ def PollJob(rapi_client, job_id, reporter):
   @type reporter: L{cli.JobPollReportCbBase}
   @param reporter: PollJob reporter instance
 
+  @return: The opresult of the job
+  @raise errors.JobLost: If job can't be found
+  @raise errors.OpExecError: if job didn't succeed
+
+  @see: L{ganeti.cli.GenericPollJob}
+
   """
   return cli.GenericPollJob(job_id, RapiJobPollCb(rapi_client), reporter)
diff --git a/tools/move-instance b/tools/move-instance
index 087fd3f..ba8f686 100755
--- a/tools/move-instance
+++ b/tools/move-instance
@@ -468,6 +468,12 @@ class MoveRuntime(object):
     @param remote_import_fn: Callback for reporting received remote import
                              information
 
+    @return: opreturn of the move job
+    @raise errors.JobLost: If job can't be found
+    @raise errors.OpExecError: If job didn't succeed
+
+    @see: L{ganeti.rapi.client_utils.PollJob}
+
     """
     return rapi.client_utils.PollJob(cl, job_id,
                                      MoveJobPollReportCb(self.CheckAbort,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list