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
5df2dadc
Commit
5df2dadc
authored
Apr 16, 2013
by
Seth Vidal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up how it puts the files in place - in f18 /tmp is tmpfs which
means ln and os.rename() won't work across fs.
parent
84fb92da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
library/cron
+12
-3
No files found.
library/cron
View file @
5df2dadc
...
@@ -132,6 +132,7 @@ updates: Mike Grozak
...
@@ -132,6 +132,7 @@ updates: Mike Grozak
import
re
import
re
import
tempfile
import
tempfile
import
os
def
get_jobs_file
(
module
,
user
,
tmpfile
,
cron_file
):
def
get_jobs_file
(
module
,
user
,
tmpfile
,
cron_file
):
if
cron_file
:
if
cron_file
:
...
@@ -143,11 +144,19 @@ def get_jobs_file(module, user, tmpfile, cron_file):
...
@@ -143,11 +144,19 @@ def get_jobs_file(module, user, tmpfile, cron_file):
def
install_jobs
(
module
,
user
,
tmpfile
,
cron_file
):
def
install_jobs
(
module
,
user
,
tmpfile
,
cron_file
):
if
cron_file
:
if
cron_file
:
cmd
=
"ln -f
%
s /etc/cron.d/
%
s"
%
(
tmpfile
,
cron_file
)
cron_file
=
'/etc/cron.d/
%
s'
%
cron_file
try
:
module
.
atomic_replace
(
tmpfile
,
cron_file
)
except
(
OSError
,
IOError
),
e
:
return
(
1
,
""
,
str
(
e
))
except
:
return
(
1
,
""
,
str
(
e
))
else
:
return
(
0
,
""
,
""
)
else
:
else
:
cmd
=
"crontab
%
s
%
s"
%
(
user
,
tmpfile
)
cmd
=
"crontab
%
s
%
s"
%
(
user
,
tmpfile
)
return
module
.
run_command
(
cmd
)
return
module
.
run_command
(
cmd
)
def
get_jobs
(
tmpfile
):
def
get_jobs
(
tmpfile
):
lines
=
open
(
tmpfile
)
.
read
()
.
splitlines
()
lines
=
open
(
tmpfile
)
.
read
()
.
splitlines
()
...
...
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