diff options
author | Michael Scherer <misc@zarb.org> | 2016-10-17 15:33:02 +0200 |
---|---|---|
committer | Toshio Kuratomi <a.badger@gmail.com> | 2016-10-17 13:48:18 -0700 |
commit | 3f77bb6857243992f95316e3cd37d01e7f229d64 (patch) | |
tree | 3098a759c77bcd277d0dded66bad12a9d0840454 /clustering/consul_session.py | |
parent | 8dd32a8134f361185799368fce155393605175a3 (diff) | |
download | ansible-modules-extras-3f77bb6857243992f95316e3cd37d01e7f229d64.tar.gz |
Make consul modules pass sanity test for python 3
Diffstat (limited to 'clustering/consul_session.py')
-rw-r--r-- | clustering/consul_session.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clustering/consul_session.py b/clustering/consul_session.py index 4d733561..7b9c4bbb 100644 --- a/clustering/consul_session.py +++ b/clustering/consul_session.py @@ -137,7 +137,7 @@ try: import consul from requests.exceptions import ConnectionError python_consul_installed = True -except ImportError, e: +except ImportError: python_consul_installed = False def execute(module): @@ -185,7 +185,7 @@ def lookup_sessions(module): session_id=session_id, sessions=session_by_id) - except Exception, e: + except Exception as e: module.fail_json(msg="Could not retrieve session info %s" % e) @@ -216,7 +216,7 @@ def update_session(module): delay=delay, checks=checks, node=node) - except Exception, e: + except Exception as e: module.fail_json(msg="Could not create/update session %s" % e) @@ -233,7 +233,7 @@ def remove_session(module): module.exit_json(changed=True, session_id=session_id) - except Exception, e: + except Exception as e: module.fail_json(msg="Could not remove session with id '%s' %s" % ( session_id, e)) @@ -270,10 +270,10 @@ def main(): try: execute(module) - except ConnectionError, e: + except ConnectionError as e: module.fail_json(msg='Could not connect to consul agent at %s:%s, error was %s' % ( module.params.get('host'), module.params.get('port'), str(e))) - except Exception, e: + except Exception as e: module.fail_json(msg=str(e)) # import module snippets |