From b297940aea9b22c6de4e2f7d2fcdbb2db86b107d Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Tue, 21 Jul 2015 19:38:06 +0200 Subject: PrioDir: Only set text content, if something is available This is used for the Rules and Defaults plugins. Without this patch all text content that was there before (for example file content bound by Cfg) is lost, for all entries specified in Defaults. --- src/lib/Bcfg2/Server/Plugin/helpers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/Bcfg2/Server/Plugin/helpers.py b/src/lib/Bcfg2/Server/Plugin/helpers.py index 5cfc8998c..3b62a3217 100644 --- a/src/lib/Bcfg2/Server/Plugin/helpers.py +++ b/src/lib/Bcfg2/Server/Plugin/helpers.py @@ -1064,7 +1064,8 @@ class PrioDir(Plugin, Generator, XMLDirectoryBacked): data = candidate break - entry.text = data.text + if data.text is not None and data.text.strip() != '': + entry.text = data.text for item in data.getchildren(): entry.append(copy.copy(item)) -- cgit v1.2.3-1-g7c22