From 49dca37b46fb5a7ee9ce0746e281d15f50ec5690 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Nov 2012 09:01:29 +0100 Subject: [PATCH] s4:samba-tool/testparm: report a CommandError if loading of the config file fails Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit 11f5d54cbb10fd5c5f0e1718427609709c3476f4) --- 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 34c8fa5..9251469 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) -- 1.7.9.5