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 8813d3edafa..3ca201a5d4b 100644 --- a/lib/ansible/modules/database/influxdb/influxdb_user.py +++ b/lib/ansible/modules/database/influxdb/influxdb_user.py @@ -94,7 +94,7 @@ def find_user(module, client, user_name): if user['user'] == user_name: user_result = user 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 user_result