Skip to content

Commit

Permalink
Merge pull request #50732 from rokasz/zookeeper_empty_acl_fix
Browse files Browse the repository at this point in the history
Ignoring ACL check for empty ACL in zookeeper.present
  • Loading branch information
Mike Place authored Dec 10, 2018
2 parents addced9 + 0d07300 commit bacdcef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions salt/states/zookeeper.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,19 @@ def present(name, value, acls=None, ephemeral=False, sequence=False, makepath=Fa
if __salt__['zookeeper.exists'](name, **connkwargs):
cur_value = __salt__['zookeeper.get'](name, **connkwargs)
cur_acls = __salt__['zookeeper.get_acls'](name, **connkwargs)
if cur_value == value and _check_acls(cur_acls, chk_acls):
if cur_value == value and (not chk_acls or _check_acls(cur_acls, chk_acls)):
ret['result'] = True
ret['comment'] = 'Znode {0} is already set to the correct value with the correct acls'.format(name)
return ret
elif __opts__['test'] is True:
ret['result'] = None
ret['comment'] = 'Znode {0} is will be updated'.format(name)
ret['comment'] = 'Znode {0} will be updated'.format(name)
ret['changes']['old'] = {}
ret['changes']['new'] = {}
if value != cur_value:
ret['changes']['old']['value'] = cur_value
ret['changes']['new']['value'] = value
if not _check_acls(chk_acls, cur_acls):
if chk_acls and not _check_acls(chk_acls, cur_acls):
ret['changes']['old']['acls'] = cur_acls
ret['changes']['new']['acls'] = chk_acls
return ret
Expand Down

0 comments on commit bacdcef

Please sign in to comment.