* Amends #47040 - Prevents potential accidental password changes to blank * Added changelog fragmentpull/4420/head
parent
b079070688
commit
b422c59ada
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- influxdb_user - An unspecified password now sets the password to blank, except on existing users. This previously caused an unhandled exception.
|
|
@ -157,7 +157,7 @@ def main():
|
||||||
|
|
||||||
state = module.params['state']
|
state = module.params['state']
|
||||||
user_name = module.params['user_name']
|
user_name = module.params['user_name']
|
||||||
user_password = module.params['user_password'] or ''
|
user_password = module.params['user_password']
|
||||||
admin = module.params['admin']
|
admin = module.params['admin']
|
||||||
influxdb = influx.InfluxDb(module)
|
influxdb = influx.InfluxDb(module)
|
||||||
client = influxdb.connect_to_influxdb()
|
client = influxdb.connect_to_influxdb()
|
||||||
|
@ -167,7 +167,7 @@ def main():
|
||||||
if user:
|
if user:
|
||||||
changed = False
|
changed = False
|
||||||
|
|
||||||
if not check_user_password(module, client, user_name, user_password):
|
if not check_user_password(module, client, user_name, user_password) and user_password is not None:
|
||||||
set_user_password(module, client, user_name, user_password)
|
set_user_password(module, client, user_name, user_password)
|
||||||
changed = True
|
changed = True
|
||||||
|
|
||||||
|
@ -183,6 +183,7 @@ def main():
|
||||||
|
|
||||||
module.exit_json(changed=changed)
|
module.exit_json(changed=changed)
|
||||||
else:
|
else:
|
||||||
|
user_password = user_password or ''
|
||||||
create_user(module, client, user_name, user_password, admin)
|
create_user(module, client, user_name, user_password, admin)
|
||||||
|
|
||||||
if state == 'absent':
|
if state == 'absent':
|
||||||
|
|
Loading…
Reference in New Issue