2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Fix clearing of a group attribute not clearing inherited values

This commit is contained in:
jbjohnso 2014-04-23 09:38:42 -04:00
parent fb87555776
commit 2db5004c54

View File

@ -821,8 +821,17 @@ class ConfigManager(object):
pass
for node in groupentry['nodes']:
nodecfg = self._cfgstore['nodes'][node]
self._do_inheritance(
nodecfg, attrib, node, changeset)
try:
delnodeattrib = (
nodecfg[attrib]['inheritedfrom'] == group)
except KeyError:
delnodeattrib = False
if delnodeattrib:
_mark_dirtykey('nodes', node, self.tenant)
del nodecfg[attrib]
self._do_inheritance(nodecfg, attrib, node,
changeset)
_addchange(changeset, node, attrib)
self._notif_attribwatchers(changeset)
self._bg_sync_to_file()
@ -1104,3 +1113,13 @@ try:
ConfigManager._read_from_path()
except IOError:
_cfgstore = {}
# some unit tests worth implementing:
# set group attribute on lower priority group, result is that node should not
# change
# after that point, then unset on the higher priority group, lower priority
# group should get it then
# rinse and repeat for set on node versus set on group
# clear group attribute and assure than it becomes unset on all nodes
# set various expressions