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
Kirill Smelkov
slapos.toolbox
Commits
0f38ef39
Commit
0f38ef39
authored
Sep 13, 2013
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix on the last added function (cloneDefaultGit)
parent
a928b0b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
7 deletions
+6
-7
slapos/runner/__init__.py
slapos/runner/__init__.py
+2
-3
slapos/runner/utils.py
slapos/runner/utils.py
+4
-4
No files found.
slapos/runner/__init__.py
View file @
0f38ef39
...
@@ -11,7 +11,7 @@ import os
...
@@ -11,7 +11,7 @@ import os
import
slapos.runner.process
import
slapos.runner.process
import
sys
import
sys
from
slapos.runner.utils
import
runInstanceWithLock
from
slapos.runner.utils
import
runInstanceWithLock
from
utils
import
cloneDefault
g
it
from
utils
import
cloneDefault
G
it
class
Parser
(
OptionParser
):
class
Parser
(
OptionParser
):
...
@@ -121,8 +121,6 @@ def run():
...
@@ -121,8 +121,6 @@ def run():
# avoid mistakes (mainly in development mode)
# avoid mistakes (mainly in development mode)
raise
Exception
(
'Do not run SlapRunner as root.'
)
raise
Exception
(
'Do not run SlapRunner as root.'
)
cloneDefaultgit
()
serve
(
config
)
serve
(
config
)
return_code
=
0
return_code
=
0
except
SystemExit
as
err
:
except
SystemExit
as
err
:
...
@@ -152,6 +150,7 @@ def serve(config):
...
@@ -152,6 +150,7 @@ def serve(config):
os
.
mkdir
(
workdir
)
os
.
mkdir
(
workdir
)
if
not
os
.
path
.
exists
(
software_link
):
if
not
os
.
path
.
exists
(
software_link
):
os
.
mkdir
(
software_link
)
os
.
mkdir
(
software_link
)
cloneDefaultGit
(
app
.
config
)
slapos
.
runner
.
process
.
setHandler
()
slapos
.
runner
.
process
.
setHandler
()
config
.
logger
.
info
(
'Running slapgrid...'
)
config
.
logger
.
info
(
'Running slapgrid...'
)
runInstanceWithLock
(
app
.
config
)
runInstanceWithLock
(
app
.
config
)
...
...
slapos/runner/utils.py
View file @
0f38ef39
...
@@ -805,14 +805,14 @@ def readParameters(path):
...
@@ -805,14 +805,14 @@ def readParameters(path):
return "No such file or directory: %s" % path
return "No such file or directory: %s" % path
def cloneDefaultGit():
def cloneDefaultGit(
config
):
"""Test if the slapos git has been downloaded yet
"""Test if the slapos git has been downloaded yet
If not, download it in read-only mode"""
If not, download it in read-only mode"""
slap = os.path.join(config
.runner_workdir
, '
project
', '
slapos
')
slap = os.path.join(config
['
runner_workdir
']
, '
project
', '
slapos
')
slap_ro = os.path.join(config
.runner_workdir
, '
project
', '
slapos
-
readonly
')
slap_ro = os.path.join(config
['
runner_workdir
']
, '
project
', '
slapos
-
readonly
')
if not os.path.exists(slap_ro) or not os.path.exists(slap_ro):
if not os.path.exists(slap_ro) or not os.path.exists(slap_ro):
from gittools import cloneRepo
from gittools import cloneRepo
user =
open(os.path.join(config.etc_dir, '
.
users
')).read().split('
;
')
user =
getSession(config)
data = {'
path
': slap_ro,
data = {'
path
': slap_ro,
'
repo
': '
http
:
//
git
.
erp5
.
org
/
repos
/
slapos
.
git
',
'
repo
': '
http
:
//
git
.
erp5
.
org
/
repos
/
slapos
.
git
',
'
email
': user[2],
'
email
': user[2],
...
...
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