mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Do not require password when deleting os_user (#5601)
I broke backwards compat with the addition to define when a password should be updated. It was requiring that a password value be passed when deleting a user, which seems silly. This moves the argument logic out of the argument spec and into when it would be needed, when state is present.
This commit is contained in:
parent
be7af0193d
commit
4c3f8cbd92
1 changed files with 5 additions and 4 deletions
|
@ -191,10 +191,6 @@ def main():
|
||||||
module_kwargs = openstack_module_kwargs()
|
module_kwargs = openstack_module_kwargs()
|
||||||
module = AnsibleModule(
|
module = AnsibleModule(
|
||||||
argument_spec,
|
argument_spec,
|
||||||
required_if=[
|
|
||||||
('update_password', 'always', ['password']),
|
|
||||||
('update_password', 'on_create', ['password']),
|
|
||||||
],
|
|
||||||
**module_kwargs)
|
**module_kwargs)
|
||||||
|
|
||||||
if not HAS_SHADE:
|
if not HAS_SHADE:
|
||||||
|
@ -219,6 +215,11 @@ def main():
|
||||||
domain_id = _get_domain_id(opcloud, domain)
|
domain_id = _get_domain_id(opcloud, domain)
|
||||||
|
|
||||||
if state == 'present':
|
if state == 'present':
|
||||||
|
if update_password in ('always', 'on_create'):
|
||||||
|
if not password:
|
||||||
|
msg = ("update_password is %s but a password value is "
|
||||||
|
"missing") % update_password
|
||||||
|
self.fail_json(msg=msg)
|
||||||
default_project_id = None
|
default_project_id = None
|
||||||
if default_project:
|
if default_project:
|
||||||
default_project_id = _get_default_project_id(cloud, default_project)
|
default_project_id = _get_default_project_id(cloud, default_project)
|
||||||
|
|
Loading…
Reference in a new issue