Commit f6398d3f authored by Matthieu Lamalle's avatar Matthieu Lamalle
Browse files

Merge branch '435_no_returns_in_list' into 'develop'

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

See merge request !12
parents 9d343d92 83662581
Pipeline #564 passed with stage
in 0 seconds
...@@ -48,7 +48,6 @@ class SaltJobs(): ...@@ -48,7 +48,6 @@ class SaltJobs():
WHERE jids.jid = salt_returns.jid WHERE jids.jid = salt_returns.jid
) AS executed, ) AS executed,
salt_returns.full_ret->>'retcode' AS retcode, salt_returns.full_ret->>'retcode' AS retcode,
salt_returns.full_ret->>'return' AS return,
salt_returns.full_ret->>'id' AS minion, salt_returns.full_ret->>'id' AS minion,
load->>'fun' AS fun, load->>'fun' AS fun,
load->'arg' AS fun_args, load->'arg' AS fun_args,
...@@ -82,7 +81,7 @@ class SaltJobs(): ...@@ -82,7 +81,7 @@ class SaltJobs():
self.config = config self.config = config
self.db_connection = None self.db_connection = None
def job_to_dict(self, job): def job_to_dict(self, job, with_returns=True):
dico = { dico = {
"jid": job['jid'], "jid": job['jid'],
"executed": job['executed'], "executed": job['executed'],
...@@ -96,7 +95,8 @@ class SaltJobs(): ...@@ -96,7 +95,8 @@ class SaltJobs():
if job['retcode'] is not None: if job['retcode'] is not None:
dico["retcode"] = int(job['retcode']) dico["retcode"] = int(job['retcode'])
dico["success"] = dico['retcode'] == 0 dico["success"] = dico['retcode'] == 0
dico["return"] = job['return'] if with_returns:
dico["return"] = job['return']
dico["minion"] = job['minion'] dico["minion"] = job['minion']
else: else:
dico["minion"] = job['target'] dico["minion"] = job['target']
...@@ -111,7 +111,7 @@ class SaltJobs(): ...@@ -111,7 +111,7 @@ class SaltJobs():
raise Exception(_('only alphanum are allowed for a minion ID')) raise Exception(_('only alphanum are allowed for a minion ID'))
rows = cursor.execute(self.fetch_all_jobs % (minion_pattern,)) rows = cursor.execute(self.fetch_all_jobs % (minion_pattern,))
for row in cursor.fetchall(): for row in cursor.fetchall():
ret = self.job_to_dict(row) ret = self.job_to_dict(row, False)
if ret is not None: if ret is not None:
yield ret 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