Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Joanne Hugé
slapos.toolbox
Commits
5f46db69
Commit
5f46db69
authored
Sep 12, 2019
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
promise/plugin: Use check_output instead of hand crafting
parent
b1bc3918
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
slapos/promise/plugin/check_command_execute.py
slapos/promise/plugin/check_command_execute.py
+5
-4
No files found.
slapos/promise/plugin/check_command_execute.py
View file @
5f46db69
...
@@ -22,13 +22,14 @@ class RunPromise(GenericPromise):
...
@@ -22,13 +22,14 @@ class RunPromise(GenericPromise):
command
=
self
.
getConfig
(
'command'
)
command
=
self
.
getConfig
(
'command'
)
try
:
try
:
process
=
subprocess
.
Popen
(
out
=
subprocess
.
check_output
(
command
,
command
,
shell
=
True
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
stderr
=
subprocess
.
STDOUT
)
out
,
_
=
process
.
communicate
()
status
=
0
status
=
process
.
returncode
except
subprocess
.
CalledProcessError
as
e
:
out
=
e
.
output
status
=
e
.
returncode
except
Exception
as
e
:
except
Exception
as
e
:
self
.
logger
.
error
(
self
.
logger
.
error
(
"ERROR %r during running command %r"
%
(
e
,
command
))
"ERROR %r during running command %r"
%
(
e
,
command
))
...
...
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