* Amends #47040 - Prevents potential accidental password changes to blank * Added changelog fragment
This commit is contained in:
parent
b079070688
commit
b422c59ada
2 changed files with 6 additions and 2 deletions
|
@ -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']
|
||||
user_name = module.params['user_name']
|
||||
user_password = module.params['user_password'] or ''
|
||||
user_password = module.params['user_password']
|
||||
admin = module.params['admin']
|
||||
influxdb = influx.InfluxDb(module)
|
||||
client = influxdb.connect_to_influxdb()
|
||||
|
@ -167,7 +167,7 @@ def main():
|
|||
if user:
|
||||
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)
|
||||
changed = True
|
||||
|
||||
|
@ -183,6 +183,7 @@ def main():
|
|||
|
||||
module.exit_json(changed=changed)
|
||||
else:
|
||||
user_password = user_password or ''
|
||||
create_user(module, client, user_name, user_password, admin)
|
||||
|
||||
if state == 'absent':
|
||||
|
|
Loading…
Reference in a new issue