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
HongzheWang
slapos
Commits
b4186836
Commit
b4186836
authored
Oct 31, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use check_call
parent
42a64bd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
slapos/recipe/accords/accords.py
slapos/recipe/accords/accords.py
+13
-9
No files found.
slapos/recipe/accords/accords.py
View file @
b4186836
...
...
@@ -29,6 +29,7 @@
import
os
from
slapos
import
slap
import
signal
import
subprocess
from
subprocess
import
Popen
import
sys
import
time
...
...
@@ -44,32 +45,35 @@ def runAccords(accords_conf):
key_file
=
accords_conf
[
'key_file'
]
cert_file
=
accords_conf
[
'cert_file'
]
accords_lib_directory
=
accords_conf
[
'accords_lib_directory'
]
poc_location
=
accords_conf
[
'poc
_location'
]
accords_location
=
accords_conf
[
'accords
_location'
]
manifest_name
=
accords_conf
[
'manifest_name'
]
environment
=
dict
(
LD_LIBRARY_PATH
=
accords_lib_directory
,
PATH
=
accords_conf
[
'path'
],
PATH
=
accords_conf
[
'path'
],
HOME
=
accords_location
,
)
# Set handler to stop ACCORDS when end of world comes
# XXX use subprocess.check_call and add exception handlers
def
sigtermHandler
(
signum
,
frame
):
Popen
([
'./co-command'
,
'stop'
,
'/service/*'
],
cwd
=
poc
_location
,
env
=
environment
).
communicate
()
cwd
=
accords
_location
,
env
=
environment
).
communicate
()
Popen
([
'./co-stop'
],
cwd
=
poc
_location
,
env
=
environment
).
communicate
()
cwd
=
accords
_location
,
env
=
environment
).
communicate
()
sys
.
exit
(
0
)
signal
.
signal
(
signal
.
SIGTERM
,
sigtermHandler
)
# Launch ACCORDS, parse & broke manifest to deploy instance
Popen
([
'./co-start'
],
cwd
=
poc_location
,
env
=
environment
).
communicate
()
print
'Starting ACCORDS and friends...'
subprocess
.
check_call
([
'./co-start'
],
cwd
=
accords_location
,
env
=
environment
)
print
'Parsing manifest...'
Popen
([
'./co-parser'
,
manifest_name
],
cwd
=
poc_location
,
env
=
environment
).
communicate
(
)
subprocess
.
check_call
([
'./co-parser'
,
manifest_name
],
cwd
=
accords_location
,
env
=
environment
)
print
'Brokering manifest...'
Popen
([
'./co-broker'
,
manifest_name
],
cwd
=
poc_location
,
env
=
environment
).
communicate
(
)
subprocess
.
check_call
([
'./co-broker'
,
manifest_name
],
cwd
=
accords_location
,
env
=
environment
)
print
'Done.'
# Parse answer
...
...
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