summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Properties.py
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-24 11:54:44 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-24 11:58:04 -0400
commit4fb636cd7ff2d3f4352613932d2c02c08aba1636 (patch)
tree957697c6c1332b5f45c0bd5e8a25287561d19708 /src/lib/Bcfg2/Server/Plugins/Properties.py
parentdd0c589a65f8bb668bdec6bffe6f3cf03b793cc5 (diff)
downloadbcfg2-4fb636cd7ff2d3f4352613932d2c02c08aba1636.tar.gz
bcfg2-4fb636cd7ff2d3f4352613932d2c02c08aba1636.tar.bz2
bcfg2-4fb636cd7ff2d3f4352613932d2c02c08aba1636.zip
improved error messages during failed decryption
Diffstat (limited to 'src/lib/Bcfg2/Server/Plugins/Properties.py')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Properties.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Properties.py b/src/lib/Bcfg2/Server/Plugins/Properties.py
index aef5238c6..a3b9c6aec 100644
--- a/src/lib/Bcfg2/Server/Plugins/Properties.py
+++ b/src/lib/Bcfg2/Server/Plugins/Properties.py
@@ -208,17 +208,14 @@ class XMLPropertyFile(Bcfg2.Server.Plugin.StructFile, PropertyFile):
Bcfg2.Server.Plugin.StructFile.Index(self)
if self.xdata.get("encryption", "false").lower() != "false":
if not HAS_CRYPTO:
- msg = "Properties: M2Crypto is not available: %s" % self.name
- LOGGER.error(msg)
- raise PluginExecutionError(msg)
+ raise PluginExecutionError("Properties: M2Crypto is not "
+ "available: %s" % self.name)
for el in self.xdata.xpath("//*[@encrypted]"):
try:
el.text = self._decrypt(el)
except EVPError:
- msg = "Failed to decrypt %s element in %s" % (el.tag,
- self.name)
- LOGGER.error(msg)
- raise PluginExecutionError(msg)
+ raise PluginExecutionError("Failed to decrypt %s element "
+ "in %s" % (el.tag, self.name))
Index.__doc__ = Bcfg2.Server.Plugin.StructFile.Index.__doc__
def _decrypt(self, element):
@@ -318,6 +315,7 @@ class Properties(Bcfg2.Server.Plugin.Plugin,
global SETUP # pylint: disable=W0603
Bcfg2.Server.Plugin.Plugin.__init__(self, core, datastore)
Bcfg2.Server.Plugin.Connector.__init__(self)
+ SETUP = core.setup
try:
self.store = PropDirectoryBacked(self.data, core.fam)
except OSError:
@@ -326,7 +324,6 @@ class Properties(Bcfg2.Server.Plugin.Plugin,
err)
raise Bcfg2.Server.Plugin.PluginInitError
- SETUP = core.setup
__init__.__doc__ = Bcfg2.Server.Plugin.Plugin.__init__.__doc__
def get_additional_data(self, metadata):