summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugin/helpers.py
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2015-09-01 10:23:10 -0500
committerSol Jerome <sol.jerome@gmail.com>2015-09-01 10:23:10 -0500
commit75466a831a92ab136a9cc2b6b875d20f0b00a889 (patch)
treee83728ee5a1f67e072e4d6fba0b7c71ecb352253 /src/lib/Bcfg2/Server/Plugin/helpers.py
parent824879eb85a1065e842930485778a594b914c77f (diff)
parent3259a1611edf97241b3a2d1bd585185907fe4e9c (diff)
downloadbcfg2-75466a831a92ab136a9cc2b6b875d20f0b00a889.tar.gz
bcfg2-75466a831a92ab136a9cc2b6b875d20f0b00a889.tar.bz2
bcfg2-75466a831a92ab136a9cc2b6b875d20f0b00a889.zip
Merge branch 'rules-replace_name' of https://github.com/AlexanderS/bcfg2
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugin/helpers.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugin/helpers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py
index 3b62a3217..6b521dfd6 100644
--- a/src/lib/Bcfg2/Server/Plugin/helpers.py
+++ b/src/lib/Bcfg2/Server/Plugin/helpers.py
@@ -1064,6 +1064,20 @@ class PrioDir(Plugin, Generator, XMLDirectoryBacked):
data = candidate
break
+ self._apply(entry, data)
+
+ def _apply(self, entry, data):
+ """ Apply all available values from data onto entry. This
+ sets the available attributes (for all attribues unset in
+ the entry), adds all children and copies the text from data
+ to entry.
+
+ :param entry: The entry to apply the changes
+ :type entry: lxml.etree._Element
+ :param data: The entry to get the data from
+ :type data: lxml.etree._Element
+ """
+
if data.text is not None and data.text.strip() != '':
entry.text = data.text
for item in data.getchildren():