summaryrefslogtreecommitdiffstats
path: root/lib/modules/postmap
diff options
context:
space:
mode:
Diffstat (limited to 'lib/modules/postmap')
-rw-r--r--lib/modules/postmap4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/modules/postmap b/lib/modules/postmap
index 8c9d54c..ce09018 100644
--- a/lib/modules/postmap
+++ b/lib/modules/postmap
@@ -1,21 +1,21 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Create or update postfix's alias and lookup tables
# Copyright (c) 2013 Guilhem Moulin <guilhem@fripost.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
try:
import selinux
HAVE_SELINUX=True
@@ -80,30 +80,30 @@ def main():
if os.path.isabs(src):
src = src
else:
module.fail_json(msg="absolute paths are required")
if not os.path.exists(src):
module.fail_json(src=src, msg="no such file")
try:
dst = "%s.%s" % (src, file_suffix(instance, db))
params['dest'] = dst
file_args = module.load_file_common_arguments(params)
changed = False
msg = None
if not os.path.exists(dst) or os.path.getmtime(dst) <= os.path.getmtime(src):
changed = True
if not module.check_mode:
msg = compile( cmd, instance, db, src)
- except subprocess.CalledProcessError, e:
+ except subprocess.CalledProcessError as e:
module.fail_json(rv=e.returncode, msg=e.output.rstrip())
changed = module.set_file_attributes_if_different(file_args, changed)
module.exit_json(changed=changed, msg=msg)
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
main()