Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
salt.3514
0052-jobs.exit_success-allow-to-check-if-a-job-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0052-jobs.exit_success-allow-to-check-if-a-job-has-execut.patch of Package salt.3514
From 9fe8bb23d49a53d5d6d2d13e7d3a7586fd12ad76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= <psuarezhernandez@suse.com> Date: Tue, 24 May 2016 09:21:43 +0100 Subject: [PATCH 52/52] jobs.exit_success allow to check if a job has executed and exit successfully jobs.exit_success() now works parsing the results of jobs.lookup_id() --- salt/runners/jobs.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/salt/runners/jobs.py b/salt/runners/jobs.py index c9c7084..120988e 100644 --- a/salt/runners/jobs.py +++ b/salt/runners/jobs.py @@ -408,6 +408,33 @@ def print_job(jid, ext_source=None, outputter=None): return ret +def exit_success(jid, ext_source=None): + ''' + Check if a job has been executed and exit successfully + + jid + The jid to look up. + ext_source + The external job cache to use. Default: `None`. + + CLI Example: + .. code-block:: bash + salt-run jobs.exit_success 20160520145827701627 + ''' + ret = dict() + + data = lookup_jid( + jid, + ext_source=ext_source + ) + + for minion in data: + if "retcode" in data[minion]: + ret[minion] = True if not data[minion]['retcode'] else False + + return ret + + def last_run(ext_source=None, outputter=None, metadata=None, -- 2.8.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor