diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-12-10 20:04:22 -0600 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-12-10 20:04:22 -0600 |
commit | fc8c4d81fd81b66c424480ce5aaa91bcf49809bb (patch) | |
tree | a9fbadf3975e9036a9f2df71c655fe615796fa70 /src | |
parent | 9d6e6241954d001a5b49e4ea9a48c10e2a792958 (diff) | |
download | bcfg2-fc8c4d81fd81b66c424480ce5aaa91bcf49809bb.tar.gz bcfg2-fc8c4d81fd81b66c424480ce5aaa91bcf49809bb.tar.bz2 bcfg2-fc8c4d81fd81b66c424480ce5aaa91bcf49809bb.zip |
testsuite: test for exceptions raised without messages
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Bcfg2/Options.py | 4 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Packages/Source.py | 2 | ||||
-rw-r--r-- | src/lib/Bcfg2/Server/Plugins/Reporting.py | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py index b418d57b0..aff8c0733 100644 --- a/src/lib/Bcfg2/Options.py +++ b/src/lib/Bcfg2/Options.py @@ -331,7 +331,7 @@ def get_bool(val): elif val in falselist: return False else: - raise ValueError + raise ValueError("Not a boolean value", val) def get_size(value): @@ -341,7 +341,7 @@ def get_size(value): return value mat = re.match("(\d+)([KkMmGg])?", value) if not mat: - raise ValueError + raise ValueError("Not a valid size", value) rvalue = int(mat.group(1)) mult = mat.group(2).lower() if mult == 'k': diff --git a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py index b98070ca9..985405e65 100644 --- a/src/lib/Bcfg2/Server/Plugins/Packages/Source.py +++ b/src/lib/Bcfg2/Server/Plugins/Packages/Source.py @@ -67,7 +67,7 @@ def fetch_url(url): if '@' in url: mobj = re.match('(\w+://)([^:]+):([^@]+)@(.*)$', url) if not mobj: - raise ValueError + raise ValueError("Invalid URL") user = mobj.group(2) passwd = mobj.group(3) url = mobj.group(1) + mobj.group(4) diff --git a/src/lib/Bcfg2/Server/Plugins/Reporting.py b/src/lib/Bcfg2/Server/Plugins/Reporting.py index 60f5b1e09..d072f1a33 100644 --- a/src/lib/Bcfg2/Server/Plugins/Reporting.py +++ b/src/lib/Bcfg2/Server/Plugins/Reporting.py @@ -1,5 +1,6 @@ """ Unified statistics and reporting plugin """ +import sys import time import platform import traceback @@ -27,7 +28,7 @@ def _rpc_call(method): return self.transport.rpc(method, *args, **kwargs) except TransportError: # this is needed for Admin.Pull - raise PluginExecutionError + raise PluginExecutionError(sys.exc_info()[1]) return _real_rpc_call |