summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Properties.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py
index 2b4196ad6..e9653a212 100644
--- a/src/lib/Bcfg2/Server/Plugins/Properties.py
+++ b/src/lib/Bcfg2/Server/Plugins/Properties.py
@@ -216,10 +216,14 @@ class XMLPropertyFile(Bcfg2.Server.Plugin.StructFile, PropertyFile):
default="strict")) == "strict"
for el in self.xdata.xpath("//*[@encrypted]"):
try:
- el.text = self._decrypt(el)
+ el.text = self._decrypt(el).encode('ascii',
+ 'xmlcharrefreplace')
+ except UnicodeDecodeError:
+ LOGGER.info("Properties: Decrypted %s to gibberish, "
+ "skipping" % el.tag)
except EVPError:
- msg = "Failed to decrypt %s element in %s" % (el.tag,
- self.name)
+ msg = "Properties: Failed to decrypt %s element in %s" % \
+ (el.tag, self.name)
if strict:
raise PluginExecutionError(msg)
else: