python: call fault_setup() if samba.getopt is used
authorStefan Metzmacher <metze@samba.org>
Fri, 25 May 2018 05:52:40 +0000 (07:52 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 12 Jun 2018 09:04:55 +0000 (11:04 +0200)
This means we have a samba command line tool written in python,
e.g. samba-tool

We should get the samba typicall backtraces instead of
just "Segmentation fault (core dumped)".

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13469

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Jun 12 11:04:55 CEST 2018 on sn-devel-144

python/samba/getopt.py

index b33a5c07ba462d67b245755093222b1a4da368b0..3c819aed61db43adf307392111af297e8e7a9481 100644 (file)
@@ -34,6 +34,8 @@ class SambaOptions(optparse.OptionGroup):
     """General Samba-related command line options."""
 
     def __init__(self, parser):
+        from samba import fault_setup
+        fault_setup()
         from samba.param import LoadParm
         optparse.OptionGroup.__init__(self, parser, "Samba Common Options")
         self.add_option("-s", "--configfile", action="callback",