take out unnecessary copy
This commit is contained in:
parent
645a7c7bd8
commit
6fcd81fff6
1 changed files with 1 additions and 3 deletions
|
@ -147,10 +147,8 @@ def get_jobs_file(module, user, tmpfile, cron_file):
|
|||
def install_jobs(module, user, tmpfile, cron_file):
|
||||
cron_file = '/etc/cron.d/%s' % cron_file
|
||||
if cron_file:
|
||||
dest_tmp = "%s.%s.%s.tmp" % (cron_file,os.getpid(),time.time())
|
||||
try:
|
||||
shutil.copyfile(tmpfile, dest_tmp)
|
||||
module.atomic_replace(dest_tmp, cron_file)
|
||||
module.atomic_replace(tmpfile, cron_file)
|
||||
except (OSError, IOError), e:
|
||||
return (1, "", str(e))
|
||||
except:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue