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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Vincent Bechu
slapos
Commits
9e672906
Commit
9e672906
authored
Mar 27, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'erp5-component' into erp5
parents
ae87f77a
0c1d06b5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
99 additions
and
84 deletions
+99
-84
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
+3
-3
stack/erp5/instance-memcached.cfg.in
stack/erp5/instance-memcached.cfg.in
+3
-3
stack/lapp/buildout.cfg
stack/lapp/buildout.cfg
+57
-42
No files found.
slapos/recipe/pbs.py
View file @
9e672906
...
...
@@ -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 @
9e672906
...
...
@@ -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 @
9e672906
...
...
@@ -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 @
9e672906
...
...
@@ -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 @
9e672906
...
...
@@ -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 @
9e672906
...
...
@@ -290,7 +290,7 @@ extra-context =
[template-memcached]
< = template-jinja2-base
filename = instance-memcached.cfg
md5sum =
2de1801236eb78651ecfd50ada46dd3b
md5sum =
346c864c1f119360eddb5e163f16d4f3
extra-context =
key dash_location dash:location
key dcron_location dcron:location
...
...
@@ -645,7 +645,7 @@ inotifyx = 0.2.0
ipdb = 0.7
ipython = 0.13.1
meld3 = 0.6.10
mr.developer = 1.2
4
mr.developer = 1.2
5
netaddr = 0.7.10
netifaces = 0.8
ordereddict = 1.1
...
...
@@ -658,7 +658,7 @@ pyPdf = 1.13
pyflakes = 0.6.1
python-ldap = 2.4.10
python-magic = 0.4.3
qrcode = 2.
4.2
qrcode = 2.
5.1
requests = 1.1.0
restkit = 4.2.1
rtjp-eventlet = 0.3.2
...
...
stack/erp5/instance-memcached.cfg.in
View file @
9e672906
...
...
@@ -27,9 +27,9 @@ recipe = slapos.cookbook:generic.kumofs
# Network options
ip = ${slap-network-information:local-ipv4}
manager-port = 13
1
01
server-port = 13
2
01
server-listen-port = 13
2
02
manager-port = 13
4
01
server-port = 13
5
01
server-listen-port = 13
5
02
# previous memcached configuration
gateway-port = 11000
# previous memcached configuration
...
...
stack/lapp/buildout.cfg
View file @
9e672906
...
...
@@ -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