Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EOLE
Zéphir
Services
SaltMaster manager
Commits
f6398d3f
Commit
f6398d3f
authored
Jun 04, 2019
by
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
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/python/zephir/saltmaster/jobs.py
View file @
f6398d3f
...
...
@@ -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,7 +95,8 @@ class SaltJobs():
if
job
[
'retcode'
]
is
not
None
:
dico
[
"retcode"
]
=
int
(
job
[
'retcode'
])
dico
[
"success"
]
=
dico
[
'retcode'
]
==
0
dico
[
"return"
]
=
job
[
'return'
]
if
with_returns
:
dico
[
"return"
]
=
job
[
'return'
]
dico
[
"minion"
]
=
job
[
'minion'
]
else
:
dico
[
"minion"
]
=
job
[
'target'
]
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment