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
44643098
Commit
44643098
authored
Jul 16, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: /slapgridResult now returns info on last slapgrid processing
parent
a0bc26e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
slapos/runner/utils.py
slapos/runner/utils.py
+10
-0
slapos/runner/views.py
slapos/runner/views.py
+10
-1
No files found.
slapos/runner/utils.py
View file @
44643098
...
@@ -283,6 +283,16 @@ def slapgridResultToFile(config, step, returncode, datetime):
...
@@ -283,6 +283,16 @@ def slapgridResultToFile(config, step, returncode, datetime):
open
(
file
,
"w"
).
write
(
json
.
dumps
(
result
))
open
(
file
,
"w"
).
write
(
json
.
dumps
(
result
))
def
getSlapgridResult
(
config
,
step
):
filename
=
step
+
"_info.json"
file
=
os
.
path
.
join
(
config
[
'runner_workdir'
],
filename
)
if
os
.
path
.
exists
(
file
):
result
=
json
.
loads
(
open
(
file
,
"r"
).
read
())
else
:
result
=
{
'last_build'
:
0
,
'success'
:
-
1
}
return
result
def
waitProcess
(
config
,
process
,
step
):
def
waitProcess
(
config
,
process
,
step
):
process
.
wait
()
process
.
wait
()
date
=
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M:%S"
)
date
=
datetime
.
datetime
.
now
().
strftime
(
"%Y-%m-%d %H:%M:%S"
)
...
...
slapos/runner/views.py
View file @
44643098
...
@@ -15,6 +15,7 @@ from flask import (Flask, request, redirect, url_for, render_template,
...
@@ -15,6 +15,7 @@ from flask import (Flask, request, redirect, url_for, render_template,
from
slapos.runner.process
import
killRunningProcess
from
slapos.runner.process
import
killRunningProcess
from
slapos.runner.utils
import
(
checkSoftwareFolder
,
configNewSR
,
from
slapos.runner.utils
import
(
checkSoftwareFolder
,
configNewSR
,
createNewUser
,
getProfilePath
,
createNewUser
,
getProfilePath
,
getSlapgridResult
,
listFolder
,
getBuildAndRunParams
,
listFolder
,
getBuildAndRunParams
,
getProjectTitle
,
getRcode
,
getSession
,
getProjectTitle
,
getRcode
,
getSession
,
getSlapStatus
,
getSvcStatus
,
getSlapStatus
,
getSvcStatus
,
...
@@ -446,7 +447,15 @@ def slapgridResult():
...
@@ -446,7 +447,15 @@ def slapgridResult():
if
os
.
path
.
exists
(
app
.
config
[
log_file
]):
if
os
.
path
.
exists
(
app
.
config
[
log_file
]):
log_result
=
readFileFrom
(
open
(
app
.
config
[
log_file
]),
log_result
=
readFileFrom
(
open
(
app
.
config
[
log_file
]),
int
(
request
.
form
[
'position'
]))
int
(
request
.
form
[
'position'
]))
return
jsonify
(
software
=
software_state
,
instance
=
instance_state
,
build_result
=
getSlapgridResult
(
app
.
config
,
'software'
)
run_result
=
getSlapgridResult
(
app
.
config
,
'instance'
)
software_info
=
{
'state'
:
software_state
,
'last_build'
:
build_result
[
'last_build'
],
'success'
:
build_result
[
'success'
]}
instance_info
=
{
'state'
:
instance_state
,
'last_build'
:
run_result
[
'last_build'
],
'success'
:
run_result
[
'success'
]}
return
jsonify
(
software
=
software_info
,
instance
=
instance_info
,
result
=
(
instance_state
or
software_state
),
content
=
log_result
)
result
=
(
instance_state
or
software_state
),
content
=
log_result
)
...
...
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