Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor tweak to user module #573

Merged
merged 1 commit into from
Jul 11, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 7 additions & 11 deletions library/user
Original file line number Diff line number Diff line change
Expand Up @@ -310,20 +310,16 @@ if append not in [ 'yes', 'no' ]:
if name is None:
fail_json(msg='name is required')

result = {}
rc = 0
rc = None
out = ''
err = ''
result = {}
result['name'] = name
if state == 'absent':
if not user_exists(name):
result['changed'] = False
else:
if user_exists(name):
(rc, out, err) = user_del(name, force=force, remove=remove)
if rc != 0:
fail_json(name=name, msg=err)
else:
result['changed'] = True
result['force'] = force
result['remove'] = remove
elif state == 'present':
Expand All @@ -338,13 +334,13 @@ elif state == 'present':
password=password, append=append)
if rc is not None and rc != 0:
fail_json(name=name, msg=err)
if rc is None:
result['changed'] = False
else:
result['changed'] = True
if password is not None:
result['password'] = 'NOTLOGGINGPASSWORD'

if rc is None:
result['changed'] = False
else:
result['changed'] = True
if out:
result['stdout'] = out
if err:
Expand Down