From 11f5d54cbb10fd5c5f0e1718427609709c3476f4 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Nov 2012 09:01:29 +0100 Subject: s4:samba-tool/testparm: report a CommandError if loading of the config file fails Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source4/scripting/python/samba/netcmd/testparm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source4/scripting/python/samba/netcmd/testparm.py b/source4/scripting/python/samba/netcmd/testparm.py index 34c8fa50fc..9251469421 100644 --- a/source4/scripting/python/samba/netcmd/testparm.py +++ b/source4/scripting/python/samba/netcmd/testparm.py @@ -82,7 +82,10 @@ class cmd_testparm(Command): raise CommandError("Both a DNS name and an IP address are " "required for the host access check") - lp = sambaopts.get_loadparm() + try: + lp = sambaopts.get_loadparm() + except RuntimeError, err: + raise CommandError(err) # We need this to force the output samba.set_debug_level(2) -- cgit