69fb75f50137d7eb70933da6c7f23d69e7768324
[certmaster.git] / certmaster / minion / modules / jobs.py
1 ## (Largely internal) module for access to asynchoronously dispatched
2 ## module job ID's. The Func Client() module wraps most of this usage
3 ## so it's not entirely relevant to folks using the CLI or Func API
4 ## directly.
5 ##
6 ## Copyright 2008, Red Hat, Inc
7 ## Michael DeHaan <mdehaan@redhat.com>
8 ##
9 ## This software may be freely redistributed under the terms of the GNU
10 ## general public license.
11 ##
12 ## You should have received a copy of the GNU General Public License
13 ## along with this program; if not, write to the Free Software
14 ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15 ##
16
17 import codes
18 from func import jobthing
19 import func_module
20
21 # =================================
22
23 class JobsModule(func_module.FuncModule):
24
25 version = "0.0.1"
26 api_version = "0.0.1"
27 description = "Internal module for tracking background minion tasks."
28
29 def job_status(self, job_id):
30 """
31 Returns job status in the form of (status, datastruct).
32 Datastruct is undefined for unfinished jobs. See jobthing.py and
33 Wiki details on async invocation for more information.
34 """
35 return jobthing.job_status(job_id)
36