s4:samba-tool/testparm: report a CommandError if loading of the config file fails
[metze/samba/wip.git] / 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)