summaryrefslogtreecommitdiffstats
path: root/lib/ansible/modules/cron.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/modules/cron.py')
-rw-r--r--lib/ansible/modules/cron.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ansible/modules/cron.py b/lib/ansible/modules/cron.py
index d43c813..3500770 100644
--- a/lib/ansible/modules/cron.py
+++ b/lib/ansible/modules/cron.py
@@ -7,8 +7,7 @@
# Copyright: (c) 2015, Luca Berruti <nadirio@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
+from __future__ import annotations
DOCUMENTATION = r'''
@@ -215,6 +214,7 @@ import sys
import tempfile
from ansible.module_utils.basic import AnsibleModule
+from ansible.module_utils.common.file import S_IRWU_RWG_RWO
from ansible.module_utils.common.text.converters import to_bytes, to_native
from ansible.module_utils.six.moves import shlex_quote
@@ -308,7 +308,7 @@ class CronTab(object):
fileh = open(self.b_cron_file, 'wb')
else:
filed, path = tempfile.mkstemp(prefix='crontab')
- os.chmod(path, int('0644', 8))
+ os.chmod(path, S_IRWU_RWG_RWO)
fileh = os.fdopen(filed, 'wb')
fileh.write(to_bytes(self.render()))