Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Do not require password when deleting os_user
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
omgjlk committed Nov 15, 2016
1 parent a4cddac commit fe2cd56
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cloud/openstack/os_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,6 @@ def main():
module_kwargs = openstack_module_kwargs()
module = AnsibleModule(
argument_spec,
required_if=[
('update_password', 'always', ['password']),
('update_password', 'on_create', ['password']),
],
**module_kwargs)

if not HAS_SHADE:
Expand All @@ -219,6 +215,11 @@ def main():
domain_id = _get_domain_id(opcloud, domain)

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
if default_project:
default_project_id = _get_default_project_id(cloud, default_project)
Expand Down

0 comments on commit fe2cd56

Please sign in to comment.