mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Refactor to prevent logical bug when gid is 0
This commit is contained in:
parent
9fdaa0d5e9
commit
da23067f80
1 changed files with 2 additions and 7 deletions
|
@ -88,10 +88,6 @@ def _changes(name,
|
|||
attributes supported as integers only.
|
||||
'''
|
||||
|
||||
# Set gid to None in cases an empty string is passed
|
||||
if gid == '':
|
||||
gid = None
|
||||
|
||||
if 'shadow.info' in __salt__:
|
||||
lshad = __salt__['shadow.info'](name)
|
||||
|
||||
|
@ -460,9 +456,8 @@ def present(name,
|
|||
|
||||
if gid_from_name:
|
||||
gid = __salt__['file.group_to_gid'](name)
|
||||
if not gid:
|
||||
ret['comment'] = 'Default group with name "{0}" ' \
|
||||
'is not present'.format(name)
|
||||
if gid == '':
|
||||
ret['comment'] = 'Default group with name "{0}" is not present'.format(name)
|
||||
ret['result'] = False
|
||||
return ret
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue