From 1b7908c23308ed320574538bc78a11daba8317ab Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Wed, 19 Dec 2018 08:12:24 +0000 Subject: [PATCH] influxdb_user: Fixed unhandled exception on invalid login credentials (cherry picked from commit 498fbc88aa04b0b0653dd035cdb9b4d5ede156a1) --- changelogs/fragments/50134-influxdb_user-invalid_auth_fix.yml | 3 +++ lib/ansible/modules/database/influxdb/influxdb_user.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/50134-influxdb_user-invalid_auth_fix.yml diff --git a/changelogs/fragments/50134-influxdb_user-invalid_auth_fix.yml b/changelogs/fragments/50134-influxdb_user-invalid_auth_fix.yml new file mode 100644 index 00000000000..d39b086e1dd --- /dev/null +++ b/changelogs/fragments/50134-influxdb_user-invalid_auth_fix.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - influxdb_user - Fixed unhandled exception when using invalid login credentials (https://github.com/ansible/ansible/issues/50131) diff --git a/lib/ansible/modules/database/influxdb/influxdb_user.py b/lib/ansible/modules/database/influxdb/influxdb_user.py index 3ec22ef6ab7..cf5032dcbb7 100644 --- a/lib/ansible/modules/database/influxdb/influxdb_user.py +++ b/lib/ansible/modules/database/influxdb/influxdb_user.py @@ -93,7 +93,7 @@ def find_user(module, client, user_name): if u_name['user'] == user_name: name = u_name break - except ansible.module_utils.urls.ConnectionError as e: + except (ansible.module_utils.urls.ConnectionError, influx.exceptions.InfluxDBClientError) as e: module.fail_json(msg=str(e)) return name