try including the shutil - maybe it has the issue
This commit is contained in:
parent
38983bf892
commit
e1b8f54a7f
1 changed files with 4 additions and 4 deletions
|
@ -147,15 +147,15 @@ 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:
|
||||||
dest_tmp = "%s.%s.%s.tmp" % (cron_file,os.getpid(),time.time())
|
dest_tmp = "%s.%s.%s.tmp" % (cron_file,os.getpid(),time.time())
|
||||||
shutil.copyfile(tmpfile, dest_tmp)
|
|
||||||
try:
|
try:
|
||||||
|
shutil.copyfile(tmpfile, dest_tmp)
|
||||||
module.atomic_replace(dest_tmp, cron_file)
|
module.atomic_replace(dest_tmp, cron_file)
|
||||||
except (OSError, IOError), e:
|
except (OSError, IOError), e:
|
||||||
return (0, "", str(e))
|
return (1, "", str(e))
|
||||||
except:
|
except:
|
||||||
return (0, "", str(e))
|
return (1, "", str(e))
|
||||||
else:
|
else:
|
||||||
return (1, "", "")
|
return (0, "", "")
|
||||||
|
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue