summaryrefslogtreecommitdiffstats
path: root/lib/modules/postmulti
diff options
context:
space:
mode:
Diffstat (limited to 'lib/modules/postmulti')
-rw-r--r--lib/modules/postmulti4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/modules/postmulti b/lib/modules/postmulti
index d6ecb09..3c0a522 100644
--- a/lib/modules/postmulti
+++ b/lib/modules/postmulti
@@ -1,21 +1,21 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Create and manage postfix instances.
# 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/>.
# Look up postfix configuration variable
def postconf(k, instance=None):
@@ -77,27 +77,27 @@ def main():
cmd.extend([ '-G', group ])
cmd.extend([ '-I', 'postfix-%s' % instance ])
subprocess.check_output(cmd, stderr=subprocess.STDOUT).rstrip()
elif group != postconf('multi_instance_group', instance):
changed = True
# Assign a new group, or remove the existing group
if module.check_mode:
module.exit_json(changed=changed, msg="assign group")
cmd = [ os.path.join(os.sep, 'usr', 'sbin', 'postmulti') ]
cmd.extend([ '-e', 'assign', '-i', 'postfix-%s' % instance ])
if group:
cmd.extend([ '-G', group ])
else:
cmd.extend([ '-G', '-' ])
subprocess.check_output(cmd, stderr=subprocess.STDOUT).rstrip()
module.exit_json(changed=changed)
- except subprocess.CalledProcessError, e:
+ except subprocess.CalledProcessError as e:
module.fail_json(rv=e.returncode, msg=e.output.rstrip())
# this is magic, see lib/ansible/module_common.py
#<<INCLUDE_ANSIBLE_MODULE_COMMON>>
main()