samba.netcmd.domain: Just catch ImportError, not any parsing errors in cmd_domain_exp...
authorJelmer Vernooij <jelmer@samba.org>
Fri, 29 Aug 2014 23:57:26 +0000 (01:57 +0200)
committerDavid Disseldorp <ddiss@samba.org>
Sun, 31 Aug 2014 19:21:13 +0000 (21:21 +0200)
Change-Id: If5710565c74e87fe218a83f31cddcf64605e522e
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
python/samba/netcmd/domain.py

index 2e7a9c79c66a2a99094d72cff1818d892d0ba11c..9a06f5f01d73c83372463c70c5eae8e0912a0d10 100644 (file)
@@ -83,6 +83,9 @@ def get_testparm_var(testparm, smbconf, varname):
 
 try:
    import samba.dckeytab
+except ImportError:
+   cmd_domain_export_keytab = None
+else:
    class cmd_domain_export_keytab(Command):
        """Dump Kerberos keys of the domain into a keytab."""
 
@@ -104,8 +107,6 @@ try:
            lp = sambaopts.get_loadparm()
            net = Net(None, lp)
            net.export_keytab(keytab=keytab, principal=principal)
-except:
-   cmd_domain_export_keytab = None
 
 
 class cmd_domain_info(Command):