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
b28806a5
Commit
b28806a5
authored
Feb 14, 2014
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slaprunner: server can handle the form for custom slapgrid params
Conflicts: slapos/runner/views.py
parent
d079e94e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
slapos/runner/views.py
slapos/runner/views.py
+26
-9
No files found.
slapos/runner/views.py
View file @
b28806a5
...
@@ -23,7 +23,8 @@ from slapos.runner.utils import (checkSoftwareFolder, configNewSR, getProfilePat
...
@@ -23,7 +23,8 @@ from slapos.runner.utils import (checkSoftwareFolder, configNewSR, getProfilePat
readFileFrom
,
readParameters
,
realpath
,
readFileFrom
,
readParameters
,
realpath
,
removeInstanceRoot
,
removeProxyDb
,
removeInstanceRoot
,
removeProxyDb
,
removeSoftwareByName
,
runInstanceWithLock
,
removeSoftwareByName
,
runInstanceWithLock
,
runSoftwareWithLock
,
saveSession
,
runSoftwareWithLock
,
runSlapgridUntilSuccess
,
saveSession
,
saveBuildAndRunParams
,
svcStartStopProcess
,
svcStopAll
,
tail
,
svcStartStopProcess
,
svcStopAll
,
tail
,
updateInstanceParameter
)
updateInstanceParameter
)
...
@@ -210,23 +211,15 @@ def runInstanceProfile():
...
@@ -210,23 +211,15 @@ def runInstanceProfile():
return
jsonify
(
result
=
False
)
return
jsonify
(
result
=
False
)
<<<<<<<
HEAD
def
viewInstanceLog
():
if
os
.
path
.
exists
(
app
.
config
[
'instance_log'
]):
result
=
open
(
app
.
config
[
'instance_log'
]).
read
()
=======
@
login_required
()
def
viewLog
():
def
viewLog
():
return
render_template
(
'viewLog.html'
)
return
render_template
(
'viewLog.html'
)
@
login_required
()
def
getFileLog
():
def
getFileLog
():
logfile
=
request
.
form
.
get
(
'filename'
,
''
).
encode
(
'utf-8'
)
logfile
=
request
.
form
.
get
(
'filename'
,
''
).
encode
(
'utf-8'
)
if
logfile
==
"instance.log"
:
if
logfile
==
"instance.log"
:
file_path
=
app
.
config
[
'instance_log'
]
file_path
=
app
.
config
[
'instance_log'
]
elif
logfile
==
"software.log"
:
elif
logfile
==
"software.log"
:
file_path
=
app
.
config
[
'software_log'
]
file_path
=
app
.
config
[
'software_log'
]
>>>>>>>
7
beebdd
...
Update
log
management
,
add
custom
log
file
...
else
:
else
:
file_path
=
realpath
(
app
.
config
,
logfile
)
file_path
=
realpath
(
app
.
config
,
logfile
)
try
:
try
:
...
@@ -540,6 +533,28 @@ def getParameterXml(request):
...
@@ -540,6 +533,28 @@ def getParameterXml(request):
return
jsonify
(
code
=
1
,
result
=
parameters
)
return
jsonify
(
code
=
1
,
result
=
parameters
)
#update user-defined slapgrid parameters
def
updateBuildAndRun
():
code
=
1
try
:
max_run_instance
=
int
(
request
.
form
[
'max_run_instance'
].
strip
())
max_run_software
=
int
(
request
.
form
[
'max_run_software'
].
strip
())
except
ValueError
:
code
=
0
result
=
"Error! You should have provided an integer"
run_instance
=
(
True
if
request
.
form
[
'run_instance'
]
==
"true"
else
False
)
run_software
=
(
True
if
request
.
form
[
'run_software'
]
==
"true"
else
False
)
if
code
:
params
=
{}
params
[
'run_instance'
]
=
run_instance
params
[
'run_software'
]
=
run_software
params
[
'max_run_instance'
]
=
max_run_instance
params
[
'max_run_software'
]
=
max_run_software
saveBuildAndRunParams
(
params
)
result
=
"Your parameters have correctly been updated"
return
jsonify
(
code
=
code
,
result
=
result
)
#update user account data
#update user account data
def
updateAccount
():
def
updateAccount
():
code
=
request
.
form
[
'rcode'
].
strip
()
code
=
request
.
form
[
'rcode'
].
strip
()
...
@@ -747,6 +762,8 @@ app.add_url_rule("/getPath", 'getPath', getPath, methods=['POST'])
...
@@ -747,6 +762,8 @@ app.add_url_rule("/getPath", 'getPath', getPath, methods=['POST'])
app
.
add_url_rule
(
"/myAccount"
,
'myAccount'
,
myAccount
)
app
.
add_url_rule
(
"/myAccount"
,
'myAccount'
,
myAccount
)
app
.
add_url_rule
(
"/updateAccount"
,
'updateAccount'
,
updateAccount
,
app
.
add_url_rule
(
"/updateAccount"
,
'updateAccount'
,
updateAccount
,
methods
=
[
'POST'
])
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/updateBuildAndRun"
,
'updateBuildAndRun'
,
updateBuildAndRun
,
methods
=
[
'POST'
])
app
.
add_url_rule
(
"/fileBrowser"
,
'fileBrowser'
,
fileBrowser
,
app
.
add_url_rule
(
"/fileBrowser"
,
'fileBrowser'
,
fileBrowser
,
methods
=
[
'GET'
,
'POST'
])
methods
=
[
'GET'
,
'POST'
])
app
.
add_url_rule
(
"/editFile"
,
'editFile'
,
editFile
,
methods
=
[
'GET'
])
app
.
add_url_rule
(
"/editFile"
,
'editFile'
,
editFile
,
methods
=
[
'GET'
])
...
...
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