mirror of
https://github.com/ansible/ansible.git
synced 2026-02-03 20:40:24 -05:00
review request
Signed-off-by: Abhijeet Kasurde <Akasurde@redhat.com>
This commit is contained in:
parent
4aa27cadbf
commit
fc65ca200f
1 changed files with 3 additions and 3 deletions
|
|
@ -313,8 +313,8 @@ class CronTab:
|
|||
elif self.cron_file:
|
||||
try:
|
||||
fileh = open(self.b_cron_file, 'wb')
|
||||
except FileNotFoundError as ex:
|
||||
self.module.fail_json(msg=f'Unable to open {self.cron_file} for writing as file does not exists')
|
||||
except (OSError, FileNotFoundError) as ex:
|
||||
self.module.fail_json(msg=f'Unable to open {self.cron_file} for writing: {to_native(ex)}')
|
||||
else:
|
||||
try:
|
||||
filed, path = tempfile.mkstemp(prefix='crontab')
|
||||
|
|
@ -671,7 +671,7 @@ def main():
|
|||
try:
|
||||
(dummy, backup_file) = tempfile.mkstemp(prefix='crontab')
|
||||
except OSError as ex:
|
||||
module.fail_json(msg=f"Unable to create temporary file for backup: {ex}")
|
||||
module.fail_json(msg=f"Unable to create temporary file for backup: {to_native(ex)}")
|
||||
crontab.write(backup_file)
|
||||
|
||||
if env:
|
||||
|
|
|
|||
Loading…
Reference in a new issue