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
Boxiang Sun
slapos
Commits
bd8c08f2
Commit
bd8c08f2
authored
Jul 13, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add generic execute_wait wrapper.
It waits until defined file list is available.
parent
e71e32f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
slapos/recipe/librecipe/execute.py
slapos/recipe/librecipe/execute.py
+17
-0
No files found.
slapos/recipe/librecipe/execute.py
View file @
bd8c08f2
...
...
@@ -10,6 +10,23 @@ def execute(args):
# Note: Candidate for slapos.lib.recipe
os
.
execv
(
args
[
0
],
args
+
sys
.
argv
[
1
:])
def
execute_wait
(
args
):
"""Execution but after all files in args[1] exists"""
exec_list
=
list
(
args
[
0
])
file_list
=
list
(
args
[
1
])
sleep
=
60
while
True
:
ready
=
True
for
f
in
file_list
:
if
not
os
.
path
.
exists
(
f
):
print
'File %r does not exists, sleeping for %s'
%
(
f
,
sleep
)
ready
=
False
if
ready
:
break
time
.
sleep
(
sleep
)
os
.
execv
(
exec_list
[
0
],
exec_list
+
sys
.
argv
[
1
:])
child_pg
=
None
...
...
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