Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
101
Merge Requests
101
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
ad2c26dc
Commit
ad2c26dc
authored
Mar 21, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into erp5-component
parents
7f6988dc
627226ab
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
80 deletions
+95
-80
slapos/recipe/pbs.py
slapos/recipe/pbs.py
+10
-33
slapos/recipe/request.py
slapos/recipe/request.py
+1
-1
slapos/recipe/symbolic_link.py
slapos/recipe/symbolic_link.py
+1
-1
software/maarch/development.cfg
software/maarch/development.cfg
+1
-1
software/maarch/software.cfg
software/maarch/software.cfg
+23
-0
stack/erp5/buildout.cfg
stack/erp5/buildout.cfg
+2
-2
stack/lapp/buildout.cfg
stack/lapp/buildout.cfg
+57
-42
No files found.
slapos/recipe/pbs.py
View file @
ad2c26dc
...
...
@@ -25,8 +25,7 @@
#
##############################################################################
from
hashlib
import
sha512
import
inspect
import
hashlib
import
json
import
os
import
signal
...
...
@@ -43,33 +42,14 @@ from slapos import slap as slapmodule
def
promise
(
args
):
def
failed_ssh
(
partition
,
ssh
):
def
failed_ssh
():
sys
.
stderr
.
write
(
"SSH Connection failed
\
n
"
)
try
:
ssh
.
terminate
()
except
:
pass
partition
=
slap
.
registerComputerPartition
(
args
[
'computer_id'
],
args
[
'partition_id'
])
partition
.
bang
(
"SSH Connection failed. rdiff-backup is unusable."
)
def
sigterm_handler
(
signum
,
frame
):
# Walk up in the stack to get promise local
# variables
ssh
=
None
for
upper_frame
in
inspect
.
getouterframes
(
frame
):
# Use promise.func_name insteand of 'promise' in order to be
# detected by editor if promise func name change.
# Else, it's hard to debug this kind of error.
if
upper_frame
[
3
]
==
promise
.
func_name
:
try
:
partition
=
upper_frame
[
0
].
f_locals
[
'partition'
]
ssh
=
upper_frame
[
0
].
f_locals
[
'ssh'
]
except
KeyError
:
raise
SystemExit
(
"SIGTERM Send too soon."
)
break
# If ever promise function wasn't found in the stack.
if
ssh
is
None
:
raise
SystemExit
failed_ssh
(
partition
,
ssh
)
failed_ssh
()
signal
.
signal
(
signal
.
SIGTERM
,
sigterm_handler
)
...
...
@@ -78,9 +58,6 @@ def promise(args):
key_file
=
args
.
get
(
'key_file'
),
cert_file
=
args
.
get
(
'cert_file'
))
partition
=
slap
.
registerComputerPartition
(
args
[
'computer_id'
],
args
[
'partition_id'
])
ssh
=
subprocess
.
Popen
([
args
[
'ssh_client'
],
'%(user)s@%(host)s/%(port)s'
%
args
],
stdin
=
subprocess
.
PIPE
,
stdout
=
open
(
os
.
devnull
,
'w'
),
...
...
@@ -97,7 +74,7 @@ def promise(args):
if
ssh
.
poll
()
is
None
:
return
1
if
ssh
.
returncode
!=
0
:
failed_ssh
(
partition
,
ssh
)
failed_ssh
()
return
ssh
.
returncode
...
...
@@ -108,12 +85,12 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
path_list
=
[]
url
=
entry
.
get
(
'url'
)
if
url
is
None
:
url
=
''
if
not
url
:
raise
ValueError
(
'Missing URL parameter for PBS recipe'
)
# We assume that thanks to sha512 there's no collisions
url_hash
=
sha512
(
url
).
hexdigest
()
name_hash
=
sha512
(
entry
[
'name'
]).
hexdigest
()
url_hash
=
hashlib
.
sha512
(
url
).
hexdigest
()
name_hash
=
hashlib
.
sha512
(
entry
[
'name'
]).
hexdigest
()
promise_path
=
os
.
path
.
join
(
self
.
options
[
'promises-directory'
],
url_hash
)
...
...
slapos/recipe/request.py
View file @
ad2c26dc
...
...
@@ -203,7 +203,7 @@ class RequestOptional(Recipe):
status
=
self
.
instance
.
getState
()
else
:
status
=
'not ready yet'
except
(
slapmodule
.
NotFoundError
,
slapmodule
.
ServerError
):
except
(
slapmodule
.
NotFoundError
,
slapmodule
.
ServerError
,
slapmodule
.
ResourceNotReady
):
status
=
'not ready yet'
except
AttributeError
:
status
=
'unknown'
...
...
slapos/recipe/symbolic_link.py
View file @
ad2c26dc
...
...
@@ -51,7 +51,7 @@ class Recipe:
if
os
.
path
.
lexists
(
link
):
if
not
os
.
path
.
islink
(
link
):
raise
zc
.
buildout
.
UserError
(
'Target
link already %r exists but it is not
link'
%
link
)
'Target
%r already exists but is not a
link'
%
link
)
os
.
unlink
(
link
)
os
.
symlink
(
linkline
,
link
)
self
.
logger
.
debug
(
'Created link %r -> %r'
%
(
link
,
linkline
))
...
...
software/maarch/development.cfg
View file @
ad2c26dc
...
...
@@ -35,7 +35,7 @@ git-executable = ${git:location}/bin/git
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch =
lapp-resilient3
branch =
master
git-executable = ${git:location}/bin/git
[slapos.core-repository]
...
...
software/maarch/software.cfg
View file @
ad2c26dc
...
...
@@ -13,8 +13,31 @@ parts +=
instance
instance-apache-php
slapos-recipe-maarch-egg
slapos.cookbook-repository
check-recipe
develop =
${:parts-directory}/slapos.cookbook-repository
extensions = buildout-versions
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
revision = 7dce435eca6fe2eeff60c865d41ee40db59257fa
git-executable = ${git:location}/bin/git
[check-recipe]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command =
grep parts ${buildout:develop-eggs-directory}/slapos.cookbook.egg-link
#----------------
#--
...
...
stack/erp5/buildout.cfg
View file @
ad2c26dc
...
...
@@ -141,7 +141,7 @@ parts =
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
branch = erp5
branch = erp5
-component
git-executable = ${git:location}/bin/git
[check-recipe]
...
...
@@ -346,7 +346,7 @@ repository_id_list = erp5
[erp5]
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/erp5.git
branch =
master
branch =
erp5-component
git-executable = ${git:location}/bin/git
[fix-products-paths]
...
...
stack/lapp/buildout.cfg
View file @
ad2c26dc
...
...
@@ -311,100 +311,115 @@ signature-certificate-list =
[versions]
Jinja2 = 2.6
Werkzeug = 0.8.3
apache-libcloud = 0.1
1.4
apache-libcloud = 0.1
2.1
async = 0.6.1
buildout-versions = 1.7
cp.recipe.cmd = 0.4
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.6
inotifyx = 0.2.0
lxml = 3.0.2
meld3 = 0.6.10
netaddr = 0.7.10
psycopg2 = 2.4.6
plone.recipe.command = 1.1
pycrypto = 2.6
pytz = 2012h
rdiff-backup = 1.0.5
slapos.
cookbook = 0.72.0
slapos.
recipe.build = 0.11.6
slapos.recipe.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2
slapos.toolbox = 0.33.1
smmap = 0.8.2
# Required by:
# slapos.core==0.3
3.2-dev
# slapos.toolbox==0.3
2.1-dev
# slapos.core==0.3
5.1
# slapos.toolbox==0.3
3.1
Flask = 0.9
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
GitPython = 0.3.2.RC1
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
atomize = 0.1.1
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
feedparser = 5.1.3
# Required by:
#
hexagonit.recipe.cmmi==1.6
hexagonit.recipe.download = 1.6nxd002
#
slapos.cookbook==0.74.1-dev
inotifyx = 0.2.0
# Required by:
# slapos.core==0.33.2-dev
# slapos.cookbook==0.74.1-dev
# slapos.core==0.35.1
# xml-marshaller==0.9.7
lxml = 3.1.0
# Required by:
# slapos.cookbook==0.74.1-dev
netaddr = 0.7.10
# Required by:
# slapos.core==0.35.1
netifaces = 0.8
# Required by:
# slapos.toolbox==0.3
2.1-dev
paramiko = 1.
9
.0
# slapos.toolbox==0.3
3.1
paramiko = 1.
10
.0
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
psutil = 0.6.1
# Required by:
# slapos.
core==0.33.2-dev
p
yflakes = 0.5.0
# slapos.
recipe.maarch==0.4
p
sycopg2 = 2.4.6
# Required by:
# slapos.cookbook==0.70.1-dev
# slapos.core==0.33.2-dev
# slapos.toolbox==0.32.1-dev
# slapos.core==0.35.1
pyflakes = 0.6.1
# Required by:
# slapos.cookbook==0.74.1-dev
pytz = 2013b
# Required by:
# slapos.cookbook==0.74.1-dev
# slapos.core==0.35.1
# slapos.recipe.maarch==0.4
# slapos.toolbox==0.33.1
# supervisor==3.0b1
# zc.buildout==1.6.0-dev-SlapOS-010
# zope.interface==4.0.
2
# zope.interface==4.0.
5
setuptools = 0.6c12dev-r88846
# Required by:
# slapos.core==0.33.2-dev
supervisor = 3.0b1
# slapos.cookbook==0.74.1-dev
# slapos.toolbox==0.33.1
slapos.core = 0.35.1
# Required by:
# slapos.
toolbox==0.32.1-dev
xml-marshaller = 0.9.7
# slapos.
core==0.35.1
supervisor = 3.0b1
# Required by:
# slapos.core==0.33.2-dev
zope.interface = 4.0.2
cp.recipe.cmd = 0.4
plone.recipe.command = 1.1
slapos.recipe.build = 0.11.5
slapos.toolbox = 0.33
# slapos.core==0.35.1
unittest2 = 0.5.1
# Required by:
# slapos.toolbox==0.33
slapos.core = 0.35
# slapos.cookbook==0.74.1-dev
# slapos.toolbox==0.33.1
xml-marshaller = 0.9.7
# Required by:
#
slapos.core==0.35
unittest2 = 0.5.1
#
zope.testing==4.1.2
zope.exceptions = 4.0.6
# Required by:
# zope.testing==4.1.1
zope.exceptions = 4.0.5
# slapos.core==0.35.1
# zope.testing==4.1.2
zope.interface = 4.0.5
# Required by:
# cp.recipe.cmd==0.4
zope.testing = 4.1.
1
zope.testing = 4.1.
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