summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Server/Plugins/Cfg
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/Cfg
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/Cfg')
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/CfgEncryptedGenerator.py4
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgEncryptedGenerator.py b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgEncryptedGenerator.py
index 98a807602..26faf6e2c 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/CfgEncryptedGenerator.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/CfgEncryptedGenerator.py
@@ -42,9 +42,7 @@ class CfgEncryptedGenerator(CfgGenerator):
self.data = bruteforce_decrypt(self.data, setup=SETUP,
algorithm=get_algorithm(SETUP))
except EVPError:
- msg = "Failed to decrypt %s" % self.name
- LOGGER.error(msg)
- raise PluginExecutionError(msg)
+ raise PluginExecutionError("Failed to decrypt %s" % self.name)
handle_event.__doc__ = CfgGenerator.handle_event.__doc__
def get_data(self, entry, metadata):
diff --git a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
index fe53ea809..58f6e1e42 100644
--- a/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
+++ b/src/lib/Bcfg2/Server/Plugins/Cfg/__init__.py
@@ -378,7 +378,12 @@ class CfgEntrySet(Bcfg2.Server.Plugin.EntrySet):
(action, event.filename))
self.debug_log("%s handling %s event on %s" %
(hdlr.__name__, action, event.filename))
- self.entry_init(event, hdlr)
+ try:
+ self.entry_init(event, hdlr)
+ except: # pylint: disable=W0702
+ err = sys.exc_info()[1]
+ LOGGER.error("Cfg: Failed to parse %s: %s" %
+ (event.filename, err))
return
elif hdlr.ignore(event, basename=self.path):
return