s4:samba-tool/testparm: report a CommandError if loading of the config file fails
authorStefan Metzmacher <metze@samba.org>
Fri, 9 Nov 2012 08:01:29 +0000 (09:01 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 13 Nov 2012 11:14:14 +0000 (22:14 +1100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/python/samba/netcmd/testparm.py

index 34c8fa50fcb6afb17e204f235929511d76535903..92514694218a4b46b8dca9cc40303638cfbbfcea 100644 (file)
@@ -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)