mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 19:31:26 -07:00
Make consul modules pass sanity test for python 3
This commit is contained in:
parent
d4157095f3
commit
2a83eefaae
5 changed files with 18 additions and 22 deletions
|
@ -219,7 +219,7 @@ try:
|
|||
import consul
|
||||
from requests.exceptions import ConnectionError
|
||||
python_consul_installed = True
|
||||
except ImportError, e:
|
||||
except ImportError:
|
||||
python_consul_installed = False
|
||||
|
||||
def register_with_consul(module):
|
||||
|
@ -560,10 +560,10 @@ def main():
|
|||
|
||||
try:
|
||||
register_with_consul(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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue