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
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
Ophélie Gagnard
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
Hide 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 @@
...
@@ -25,8 +25,7 @@
#
#
##############################################################################
##############################################################################
from
hashlib
import
sha512
import
hashlib
import
inspect
import
json
import
json
import
os
import
os
import
signal
import
signal
...
@@ -43,33 +42,14 @@ from slapos import slap as slapmodule
...
@@ -43,33 +42,14 @@ from slapos import slap as slapmodule
def
promise
(
args
):
def
promise
(
args
):
def
failed_ssh
(
partition
,
ssh
):
def
failed_ssh
():
sys
.
stderr
.
write
(
"SSH Connection failed
\
n
"
)
sys
.
stderr
.
write
(
"SSH Connection failed
\
n
"
)
try
:
partition
=
slap
.
registerComputerPartition
(
args
[
'computer_id'
],
ssh
.
terminate
()
args
[
'partition_id'
])
except
:
pass
partition
.
bang
(
"SSH Connection failed. rdiff-backup is unusable."
)
partition
.
bang
(
"SSH Connection failed. rdiff-backup is unusable."
)
def
sigterm_handler
(
signum
,
frame
):
def
sigterm_handler
(
signum
,
frame
):
# Walk up in the stack to get promise local
failed_ssh
()
# 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
)
signal
.
signal
(
signal
.
SIGTERM
,
sigterm_handler
)
signal
.
signal
(
signal
.
SIGTERM
,
sigterm_handler
)
...
@@ -78,9 +58,6 @@ def promise(args):
...
@@ -78,9 +58,6 @@ def promise(args):
key_file
=
args
.
get
(
'key_file'
),
key_file
=
args
.
get
(
'key_file'
),
cert_file
=
args
.
get
(
'cert_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
],
ssh
=
subprocess
.
Popen
([
args
[
'ssh_client'
],
'%(user)s@%(host)s/%(port)s'
%
args
],
stdin
=
subprocess
.
PIPE
,
stdin
=
subprocess
.
PIPE
,
stdout
=
open
(
os
.
devnull
,
'w'
),
stdout
=
open
(
os
.
devnull
,
'w'
),
...
@@ -97,7 +74,7 @@ def promise(args):
...
@@ -97,7 +74,7 @@ def promise(args):
if
ssh
.
poll
()
is
None
:
if
ssh
.
poll
()
is
None
:
return
1
return
1
if
ssh
.
returncode
!=
0
:
if
ssh
.
returncode
!=
0
:
failed_ssh
(
partition
,
ssh
)
failed_ssh
()
return
ssh
.
returncode
return
ssh
.
returncode
...
@@ -108,12 +85,12 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
...
@@ -108,12 +85,12 @@ class Recipe(GenericSlapRecipe, Notify, Callback):
path_list
=
[]
path_list
=
[]
url
=
entry
.
get
(
'url'
)
url
=
entry
.
get
(
'url'
)
if
url
is
None
:
if
not
url
:
url
=
''
raise
ValueError
(
'Missing URL parameter for PBS recipe'
)
# We assume that thanks to sha512 there's no collisions
# We assume that thanks to sha512 there's no collisions
url_hash
=
sha512
(
url
).
hexdigest
()
url_hash
=
hashlib
.
sha512
(
url
).
hexdigest
()
name_hash
=
sha512
(
entry
[
'name'
]).
hexdigest
()
name_hash
=
hashlib
.
sha512
(
entry
[
'name'
]).
hexdigest
()
promise_path
=
os
.
path
.
join
(
self
.
options
[
'promises-directory'
],
promise_path
=
os
.
path
.
join
(
self
.
options
[
'promises-directory'
],
url_hash
)
url_hash
)
...
...
slapos/recipe/request.py
View file @
ad2c26dc
...
@@ -203,7 +203,7 @@ class RequestOptional(Recipe):
...
@@ -203,7 +203,7 @@ class RequestOptional(Recipe):
status
=
self
.
instance
.
getState
()
status
=
self
.
instance
.
getState
()
else
:
else
:
status
=
'not ready yet'
status
=
'not ready yet'
except
(
slapmodule
.
NotFoundError
,
slapmodule
.
ServerError
):
except
(
slapmodule
.
NotFoundError
,
slapmodule
.
ServerError
,
slapmodule
.
ResourceNotReady
):
status
=
'not ready yet'
status
=
'not ready yet'
except
AttributeError
:
except
AttributeError
:
status
=
'unknown'
status
=
'unknown'
...
...
slapos/recipe/symbolic_link.py
View file @
ad2c26dc
...
@@ -51,7 +51,7 @@ class Recipe:
...
@@ -51,7 +51,7 @@ class Recipe:
if
os
.
path
.
lexists
(
link
):
if
os
.
path
.
lexists
(
link
):
if
not
os
.
path
.
islink
(
link
):
if
not
os
.
path
.
islink
(
link
):
raise
zc
.
buildout
.
UserError
(
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
.
unlink
(
link
)
os
.
symlink
(
linkline
,
link
)
os
.
symlink
(
linkline
,
link
)
self
.
logger
.
debug
(
'Created link %r -> %r'
%
(
link
,
linkline
))
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
...
@@ -35,7 +35,7 @@ git-executable = ${git:location}/bin/git
[slapos.cookbook-repository]
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
repository = http://git.erp5.org/repos/slapos.git
branch =
lapp-resilient3
branch =
master
git-executable = ${git:location}/bin/git
git-executable = ${git:location}/bin/git
[slapos.core-repository]
[slapos.core-repository]
...
...
software/maarch/software.cfg
View file @
ad2c26dc
...
@@ -13,8 +13,31 @@ parts +=
...
@@ -13,8 +13,31 @@ parts +=
instance
instance
instance-apache-php
instance-apache-php
slapos-recipe-maarch-egg
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 =
...
@@ -141,7 +141,7 @@ parts =
[slapos.cookbook-repository]
[slapos.cookbook-repository]
recipe = slapos.recipe.build:gitclone
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/slapos.git
repository = http://git.erp5.org/repos/slapos.git
branch = erp5
branch = erp5
-component
git-executable = ${git:location}/bin/git
git-executable = ${git:location}/bin/git
[check-recipe]
[check-recipe]
...
@@ -346,7 +346,7 @@ repository_id_list = erp5
...
@@ -346,7 +346,7 @@ repository_id_list = erp5
[erp5]
[erp5]
recipe = slapos.recipe.build:gitclone
recipe = slapos.recipe.build:gitclone
repository = http://git.erp5.org/repos/erp5.git
repository = http://git.erp5.org/repos/erp5.git
branch =
master
branch =
erp5-component
git-executable = ${git:location}/bin/git
git-executable = ${git:location}/bin/git
[fix-products-paths]
[fix-products-paths]
...
...
stack/lapp/buildout.cfg
View file @
ad2c26dc
...
@@ -311,100 +311,115 @@ signature-certificate-list =
...
@@ -311,100 +311,115 @@ signature-certificate-list =
[versions]
[versions]
Jinja2 = 2.6
Jinja2 = 2.6
Werkzeug = 0.8.3
Werkzeug = 0.8.3
apache-libcloud = 0.1
1.4
apache-libcloud = 0.1
2.1
async = 0.6.1
async = 0.6.1
buildout-versions = 1.7
buildout-versions = 1.7
cp.recipe.cmd = 0.4
gitdb = 0.5.4
gitdb = 0.5.4
hexagonit.recipe.cmmi = 1.6
hexagonit.recipe.cmmi = 1.6
inotifyx = 0.2.0
lxml = 3.0.2
meld3 = 0.6.10
meld3 = 0.6.10
netaddr = 0.7.10
plone.recipe.command = 1.1
psycopg2 = 2.4.6
pycrypto = 2.6
pycrypto = 2.6
pytz = 2012h
rdiff-backup = 1.0.5
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.download = 1.0.dev-r4053
slapos.recipe.template = 2.4.2
slapos.recipe.template = 2.4.2
slapos.toolbox = 0.33.1
smmap = 0.8.2
smmap = 0.8.2
# Required by:
# Required by:
# slapos.core==0.3
3.2-dev
# slapos.core==0.3
5.1
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
Flask = 0.9
Flask = 0.9
# Required by:
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
GitPython = 0.3.2.RC1
GitPython = 0.3.2.RC1
# Required by:
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
atomize = 0.1.1
atomize = 0.1.1
# Required by:
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
feedparser = 5.1.3
feedparser = 5.1.3
# Required by:
# Required by:
#
hexagonit.recipe.cmmi==1.6
#
slapos.cookbook==0.74.1-dev
hexagonit.recipe.download = 1.6nxd002
inotifyx = 0.2.0
# Required by:
# 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
netifaces = 0.8
# Required by:
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
paramiko = 1.
9
.0
paramiko = 1.
10
.0
# Required by:
# Required by:
# slapos.toolbox==0.3
2.1-dev
# slapos.toolbox==0.3
3.1
psutil = 0.6.1
psutil = 0.6.1
# Required by:
# Required by:
# slapos.
core==0.33.2-dev
# slapos.
recipe.maarch==0.4
p
yflakes = 0.5.0
p
sycopg2 = 2.4.6
# Required by:
# Required by:
# slapos.cookbook==0.70.1-dev
# slapos.core==0.35.1
# slapos.core==0.33.2-dev
pyflakes = 0.6.1
# slapos.toolbox==0.32.1-dev
# 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
# supervisor==3.0b1
# zc.buildout==1.6.0-dev-SlapOS-010
# zc.buildout==1.6.0-dev-SlapOS-010
# zope.interface==4.0.
2
# zope.interface==4.0.
5
setuptools = 0.6c12dev-r88846
setuptools = 0.6c12dev-r88846
# Required by:
# Required by:
# slapos.core==0.33.2-dev
# slapos.cookbook==0.74.1-dev
supervisor = 3.0b1
# slapos.toolbox==0.33.1
slapos.core = 0.35.1
# Required by:
# Required by:
# slapos.
toolbox==0.32.1-dev
# slapos.
core==0.35.1
xml-marshaller = 0.9.7
supervisor = 3.0b1
# Required by:
# Required by:
# slapos.core==0.33.2-dev
# slapos.core==0.35.1
zope.interface = 4.0.2
unittest2 = 0.5.1
cp.recipe.cmd = 0.4
plone.recipe.command = 1.1
slapos.recipe.build = 0.11.5
slapos.toolbox = 0.33
# Required by:
# Required by:
# slapos.toolbox==0.33
# slapos.cookbook==0.74.1-dev
slapos.core = 0.35
# slapos.toolbox==0.33.1
xml-marshaller = 0.9.7
# Required by:
# Required by:
#
slapos.core==0.35
#
zope.testing==4.1.2
unittest2 = 0.5.1
zope.exceptions = 4.0.6
# Required by:
# Required by:
# zope.testing==4.1.1
# slapos.core==0.35.1
zope.exceptions = 4.0.5
# zope.testing==4.1.2
zope.interface = 4.0.5
# Required by:
# Required by:
# cp.recipe.cmd==0.4
# 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