diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-07-25 19:50:58 +0200 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2016-07-25 19:50:58 +0200 |
commit | bbb7c5f59e78a4de16eb4f84c421f00ccbed1c78 (patch) | |
tree | 26b4e48f42276687a4073e722df2b16bd5acbb14 | |
parent | a25d871158f49b9b5b86303058de24c763dc2590 (diff) | |
download | bcfg2-bbb7c5f59e78a4de16eb4f84c421f00ccbed1c78.tar.gz bcfg2-bbb7c5f59e78a4de16eb4f84c421f00ccbed1c78.tar.bz2 bcfg2-bbb7c5f59e78a4de16eb4f84c421f00ccbed1c78.zip |
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.
-rw-r--r-- | src/lib/Bcfg2/Client/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
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) |