Commit 83662581 authored by gwenael remond's avatar gwenael remond
Browse files

remove 'return' in v1.server.exec.list

parent 9d343d92
Pipeline #557 passed with stage
in 0 seconds
......@@ -48,7 +48,6 @@ class SaltJobs():
WHERE jids.jid = salt_returns.jid
) AS executed,
salt_returns.full_ret->>'retcode' AS retcode,
salt_returns.full_ret->>'return' AS return,
salt_returns.full_ret->>'id' AS minion,
load->>'fun' AS fun,
load->'arg' AS fun_args,
......@@ -82,7 +81,7 @@ class SaltJobs():
self.config = config
self.db_connection = None
def job_to_dict(self, job):
def job_to_dict(self, job, with_returns=True):
dico = {
"jid": job['jid'],
"executed": job['executed'],
......@@ -96,6 +95,7 @@ class SaltJobs():
if job['retcode'] is not None:
dico["retcode"] = int(job['retcode'])
dico["success"] = dico['retcode'] == 0
if with_returns:
dico["return"] = job['return']
dico["minion"] = job['minion']
else:
......@@ -111,7 +111,7 @@ class SaltJobs():
raise Exception(_('only alphanum are allowed for a minion ID'))
rows = cursor.execute(self.fetch_all_jobs % (minion_pattern,))
for row in cursor.fetchall():
ret = self.job_to_dict(row)
ret = self.job_to_dict(row, False)
if ret is not None:
yield ret
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment