summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Properties.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py
index a3b9c6aec..2b4196ad6 100644
--- a/src/lib/Bcfg2/Server/Plugins/Properties.py
+++ b/src/lib/Bcfg2/Server/Plugins/Properties.py
@@ -210,12 +210,20 @@ class XMLPropertyFile(Bcfg2.Server.Plugin.StructFile, PropertyFile):
if not HAS_CRYPTO:
raise PluginExecutionError("Properties: M2Crypto is not "
"available: %s" % self.name)
+ strict = self.xdata.get(
+ "decrypt",
+ SETUP.cfp.get("properties", "decrypt",
+ default="strict")) == "strict"
for el in self.xdata.xpath("//*[@encrypted]"):
try:
el.text = self._decrypt(el)
except EVPError:
- raise PluginExecutionError("Failed to decrypt %s element "
- "in %s" % (el.tag, self.name))
+ msg = "Failed to decrypt %s element in %s" % (el.tag,
+ self.name)
+ if strict:
+ raise PluginExecutionError(msg)
+ else:
+ LOGGER.warning(msg)
Index.__doc__ = Bcfg2.Server.Plugin.StructFile.Index.__doc__
def _decrypt(self, element):