mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix bug in github.absent state which can cause some users to not be removed from an organization.
This commit is contained in:
parent
38a67d7648
commit
a4597770c1
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user