From bbb7c5f59e78a4de16eb4f84c421f00ccbed1c78 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Mon, 25 Jul 2016 19:50:58 +0200 Subject: Client: Fix reporting of modified entries If the client is using lxml.etree as ElementTree library, it is impossible to a single node two times in an ElementTree. The second append will remove the first insertion. We need to copy the node before appending it into the statistic tree. --- src/lib/Bcfg2/Client/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/Bcfg2/Client/__init__.py b/src/lib/Bcfg2/Client/__init__.py index 0ba775318..dc4dfb983 100644 --- a/src/lib/Bcfg2/Client/__init__.py +++ b/src/lib/Bcfg2/Client/__init__.py @@ -10,6 +10,7 @@ import fnmatch import logging import argparse import tempfile +import copy import Bcfg2.Logger import Bcfg2.Options from Bcfg2.Client import XML @@ -950,9 +951,10 @@ class Client(object): if not states[entry]], "Bad")]: container = XML.SubElement(stats, ename) for item in data: - item.set('qtext', '') - container.append(item) - item.text = None + new_item = copy.deepcopy(item) + new_item.set('qtext', '') + container.append(new_item) + new_item.text = None timeinfo = XML.Element("OpStamps") feedback.append(stats) -- cgit v1.2.3-1-g7c22