Fix bug in github.absent state which can cause some users to not be removed from an organization.

This commit is contained in:
Evan Davis 2017-07-13 13:22:15 -07:00
parent 38a67d7648
commit a4597770c1

View File

@ -123,11 +123,8 @@ def absent(name, profile="github", **kwargs):
target = __salt__['github.get_user'](name, profile=profile, **kwargs)
if not target:
ret['comment'] = 'User {0} does not exist'.format(name)
ret['result'] = True
return ret
elif isinstance(target, bool) and target:
if target:
if isinstance(target, bool) or target.get('in_org', False):
if __opts__['test']:
ret['comment'] = "User {0} will be deleted".format(name)
ret['result'] = None
@ -146,6 +143,10 @@ def absent(name, profile="github", **kwargs):
else:
ret['comment'] = "User {0} has already been deleted!".format(name)
ret['result'] = True
else:
ret['comment'] = 'User {0} does not exist'.format(name)
ret['result'] = True
return ret
return ret