From d269be6f8bfbf708eb9e2943c58e0ea5d5c262b7 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Tue, 22 Apr 2014 16:23:33 -0400 Subject: [PATCH] Implement 'unset' on group attributes --- plugins/configuration/attributes.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/configuration/attributes.py b/plugins/configuration/attributes.py index 2bf4580e..1c979385 100644 --- a/plugins/configuration/attributes.py +++ b/plugins/configuration/attributes.py @@ -136,6 +136,14 @@ def update(nodes, element, configmanager, inputdata): def update_nodegroup(group, element, configmanager, inputdata): try: + clearattribs = [] + for attrib in inputdata.attribs.iterkeys(): + if inputdata.attribs[attrib] is None: + clearattribs.append(attrib) + for attrib in clearattribs: + del inputdata.attribs[attrib] + if clearattribs: + configmanager.clear_group_attributes(group, clearattribs) configmanager.set_group_attributes({group: inputdata.attribs}) except ValueError: raise exc.InvalidArgumentException()