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
468b1dc2
Commit
468b1dc2
authored
Dec 02, 2013
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runner: pep8 test corrections
parent
97ac9598
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
slapos/runner/runnertest.py
slapos/runner/runnertest.py
+1
-1
slapos/runner/utils.py
slapos/runner/utils.py
+3
-3
slapos/runner/views.py
slapos/runner/views.py
+4
-0
No files found.
slapos/runner/runnertest.py
View file @
468b1dc2
...
@@ -429,7 +429,7 @@ class SlaprunnerTestCase(unittest.TestCase):
...
@@ -429,7 +429,7 @@ class SlaprunnerTestCase(unittest.TestCase):
# Test that the new call to isSoftwareReleaseReady
# Test that the new call to isSoftwareReleaseReady
# doesn't overwrite the previous installed one
# doesn't overwrite the previous installed one
completed_path
=
os
.
path
.
join
(
self
.
app
.
config
[
'runner_workdir'
],
completed_path
=
os
.
path
.
join
(
self
.
app
.
config
[
'runner_workdir'
],
'softwareLink'
,
'slaprunner-test'
,
'.completed'
)
'softwareLink'
,
'slaprunner-test'
,
'.completed'
)
completed_text
=
".completed file: test"
completed_text
=
".completed file: test"
completed
=
open
(
completed_path
,
"w"
)
completed
=
open
(
completed_path
,
"w"
)
completed
.
write
(
completed_text
)
completed
.
write
(
completed_text
)
...
...
slapos/runner/utils.py
View file @
468b1dc2
...
@@ -820,13 +820,13 @@ def isSoftwareReleaseReady(config):
...
@@ -820,13 +820,13 @@ def isSoftwareReleaseReady(config):
project = os.path.join(config['
etc_dir
'], '
.
project
')
project = os.path.join(config['
etc_dir
'], '
.
project
')
if not os.path.exists(project):
if not os.path.exists(project):
return "0"
return "0"
path
= open(project, 'r').readline().strip()
path = open(project, 'r').readline().strip()
software_name = path
software_name = path
if software_name[-1] == '
/
':
if software_name[-1] == '
/
':
software_name = software_name[:-1]
software_name = software_name[:-1]
software_name = software_name.split('
/
')[-1]
software_name = software_name.split('
/
')[-1]
config_SR_folder(config)
config_SR_folder(config)
if os.path.exists(os.path.join(config['
runner_workdir
'],
if os.path.exists(os.path.join(config['
runner_workdir
'],
'
softwareLink
', software_name, '
.
completed
')):
'
softwareLink
', software_name, '
.
completed
')):
return "1"
return "1"
else:
else:
...
@@ -843,7 +843,7 @@ def isSoftwareReleaseReady(config):
...
@@ -843,7 +843,7 @@ def isSoftwareReleaseReady(config):
def cloneDefaultGit(config):
def cloneDefaultGit(config):
"""Test if the default git has been downloaded yet
"""Test if the default git has been downloaded yet
If not, download it in read-only mode"""
If not, download it in read-only mode"""
default_git = os.path.join(config['
runner_workdir
'],
default_git = os.path.join(config['
runner_workdir
'],
'
project
', '
default_repo
')
'
project
', '
default_repo
')
if not os.path.exists(default_git):
if not os.path.exists(default_git):
data = {'
path
': default_git,
data = {'
path
': default_git,
...
...
slapos/runner/views.py
View file @
468b1dc2
...
@@ -43,6 +43,7 @@ logger = logging.getLogger('werkzeug')
...
@@ -43,6 +43,7 @@ logger = logging.getLogger('werkzeug')
def
login_redirect
(
*
args
,
**
kwargs
):
def
login_redirect
(
*
args
,
**
kwargs
):
return
redirect
(
url_for
(
'login'
))
return
redirect
(
url_for
(
'login'
))
@
app
.
before_request
@
app
.
before_request
def
before_request
():
def
before_request
():
if
request
.
path
.
startswith
(
'/static'
)
\
if
request
.
path
.
startswith
(
'/static'
)
\
...
@@ -57,6 +58,7 @@ def before_request():
...
@@ -57,6 +58,7 @@ def before_request():
if
request
.
path
!=
"/setAccount"
and
request
.
path
!=
"/configAccount"
:
if
request
.
path
!=
"/setAccount"
and
request
.
path
!=
"/configAccount"
:
return
redirect
(
url_for
(
'setAccount'
))
return
redirect
(
url_for
(
'setAccount'
))
# general views
# general views
def
home
():
def
home
():
return
render_template
(
'index.html'
)
return
render_template
(
'index.html'
)
...
@@ -644,9 +646,11 @@ def editFile():
...
@@ -644,9 +646,11 @@ def editFile():
def
shell
():
def
shell
():
return
render_template
(
'shell.html'
)
return
render_template
(
'shell.html'
)
def
isSRReady
():
def
isSRReady
():
return
isSoftwareReleaseReady
(
app
.
config
)
return
isSoftwareReleaseReady
(
app
.
config
)
#Setup List of URLs
#Setup List of URLs
app
.
add_url_rule
(
'/'
,
'home'
,
home
)
app
.
add_url_rule
(
'/'
,
'home'
,
home
)
app
.
add_url_rule
(
'/browseWorkspace'
,
'browseWorkspace'
,
browseWorkspace
)
app
.
add_url_rule
(
'/browseWorkspace'
,
'browseWorkspace'
,
browseWorkspace
)
...
...
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