From c793571bc337c7d612f4d70953aba78882389cf3 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Tue, 17 May 2016 19:22:29 +0200 Subject: [PATCH] Port mount to python3 and python 2.4 compatible syntax (#3678) --- lib/ansible/modules/system/mount.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/system/mount.py b/lib/ansible/modules/system/mount.py index f14eb2a556b..16202f86baf 100644 --- a/lib/ansible/modules/system/mount.py +++ b/lib/ansible/modules/system/mount.py @@ -310,7 +310,8 @@ def main(): if os.path.exists(name): try: os.rmdir(name) - except (OSError, IOError), e: + except (OSError, IOError): + e = get_exception() module.fail_json(msg="Error rmdir %s: %s" % (name, str(e))) module.exit_json(changed=changed, **args) @@ -330,7 +331,8 @@ def main(): if not os.path.exists(name) and not module.check_mode: try: os.makedirs(name) - except (OSError, IOError), e: + except (OSError, IOError): + e = get_exception() module.fail_json(msg="Error making dir %s: %s" % (name, str(e))) name, changed = set_mount(module, **args)