Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
6a0b7935
Commit
6a0b7935
authored
Mar 03, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove debug comments
parent
8e07d83a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
library/async_wrapper
+7
-7
No files found.
library/async_wrapper
View file @
6a0b7935
...
...
@@ -96,28 +96,28 @@ def _run_command(wrapped_cmd, jid, log_path):
pid
=
os
.
fork
()
if
pid
==
0
:
print
"RETURNING SUCCESS IN UNO"
#
"RETURNING SUCCESS IN UNO"
print
json
.
dumps
({
"started"
:
1
,
"ansible_job_id"
:
jid
})
sys
.
exit
(
0
)
else
:
print
"DAEMONIZED DOS"
#
"DAEMONIZED DOS"
sub_pid
=
os
.
fork
()
if
sub_pid
==
0
:
print
"RUNNING IN KID A"
#
"RUNNING IN KID A"
_run_command
(
cmd
,
jid
,
log_path
)
sys
.
exit
(
0
)
else
:
print
"WATCHING IN KID B"
#
"WATCHING IN KID B"
remaining
=
int
(
time_limit
)
if
os
.
path
.
exists
(
"/proc/
%
s"
%
sub_pid
):
print
"STILL RUNNING"
#
"STILL RUNNING"
time
.
sleep
(
1
)
remaining
=
remaining
-
1
else
:
print
"DONE IN KID B"
#
"DONE IN KID B"
sys
.
exit
(
0
)
if
remaining
==
0
:
print
"SLAYING IN KID B"
#
"SLAYING IN KID B"
os
.
kill
(
sub_pid
,
signals
.
SIGKILL
)
sys
.
exit
(
1
)
...
...
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