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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
slapos.toolbox
Commits
a52ea2ff
Commit
a52ea2ff
authored
9 years ago
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slaprunner: Support command exiting with non 0 status in minishell
parent
778eab49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
slapos/runner/static/js/scripts/shell.js
slapos/runner/static/js/scripts/shell.js
+5
-2
slapos/runner/views.py
slapos/runner/views.py
+1
-3
No files found.
slapos/runner/static/js/scripts/shell.js
View file @
a52ea2ff
...
...
@@ -45,8 +45,11 @@ $(document).ready(function () {
timeout
:
600000
})
.
done
(
function
(
data
)
{
var
data
=
"
<p><span class=
\"
runned-command
\"
>
"
+
data
.
path
+
"
>>>
"
+
command
+
"
</span></p><br/><pre>
"
+
data
.
data
+
"
</pre><br/>
"
;
$
(
"
#shell-result
"
).
append
(
data
);
var
output
=
$
(
"
<pre>
"
).
text
(
data
.
data
);
if
(
data
.
error
)
{
output
.
css
({
"
color
"
:
"
red
"
});
}
$
(
"
#shell-result
"
).
append
(
"
<p><span class=
\"
runned-command
\"
>
"
+
data
.
path
+
"
>>>
"
+
command
+
"
</span></p><br/>
"
).
append
(
output
);
$
(
"
#shell-input
"
).
val
(
""
);
$
(
"
#shell-result
"
).
scrollTop
(
$
(
"
#shell-result
"
)[
0
].
scrollHeight
);
updateHistory
();
...
...
This diff is collapsed.
Click to expand it.
slapos/runner/views.py
View file @
a52ea2ff
...
...
@@ -753,9 +753,7 @@ def runCommand():
command
=
"timeout 600 "
+
command
return
jsonify
(
path
=
cwd
,
data
=
subprocess
.
check_output
(
command
,
stderr
=
subprocess
.
STDOUT
,
shell
=
True
,
cwd
=
cwd
,
env
=
{
'PATH'
:
app
.
config
[
'path'
]}))
except
subprocess
.
CalledProcessError
as
e
:
error
=
"Error : process exited with exit code "
+
str
(
e
.
returncode
)
+
\
"
\
n
Process says :
\
n
"
+
e
.
output
return
error
return
jsonify
(
path
=
cwd
,
data
=
e
.
output
,
returncode
=
e
.
returncode
,
error
=
True
)
def
getMiniShellHistory
():
...
...
This diff is collapsed.
Click to expand it.
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