The Samba-Bugzilla – Attachment 8172 Details for
Bug 9373
Output of 'samba-tool' does not look very nice
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Prosposed patches done by Metze
tmp.diff (text/plain), 2.85 KB, created by
Karolin Seeger
on 2012-11-09 08:50:13 UTC
(
hide
)
Description:
Prosposed patches done by Metze
Filename:
MIME Type:
Creator:
Karolin Seeger
Created:
2012-11-09 08:50:13 UTC
Size:
2.85 KB
patch
obsolete
>From a08808f60427a5c73a76ddf6c59ddd90b3d89382 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Fri, 9 Nov 2012 09:00:41 +0100 >Subject: [PATCH 1/2] s4:samba-tool: don't print python stack traces in debug > level 0 > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >--- > source4/scripting/python/samba/netcmd/__init__.py | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/source4/scripting/python/samba/netcmd/__init__.py b/source4/scripting/python/samba/netcmd/__init__.py >index a3edf50..1a39c85 100644 >--- a/source4/scripting/python/samba/netcmd/__init__.py >+++ b/source4/scripting/python/samba/netcmd/__init__.py >@@ -91,16 +91,20 @@ class Command(object): > > def show_command_error(self, e): > '''display a command error''' >+ force_traceback = False >+ > if isinstance(e, CommandError): > (etype, evalue, etraceback) = e.exception_info > inner_exception = e.inner_exception > message = e.message >- force_traceback = False >+ if samba.get_debug_level() >= 3: >+ force_traceback = True > else: > (etype, evalue, etraceback) = sys.exc_info() > inner_exception = e > message = "uncaught exception" >- force_traceback = True >+ if samba.get_debug_level() >= 1: >+ force_traceback = True > > if isinstance(inner_exception, LdbError): > (ldb_ecode, ldb_emsg) = inner_exception >@@ -119,7 +123,7 @@ class Command(object): > self.errf.write("ERROR(%s): %s - %s\n" % (str(etype), message, evalue)) > force_traceback = True > >- if force_traceback or samba.get_debug_level() >= 3: >+ if force_traceback: > traceback.print_tb(etraceback) > > def _create_parser(self, prog, epilog=None): >-- >1.7.9.5 > > >From cf77b64d7332130b9202e0766e78d34061216d72 Mon Sep 17 00:00:00 2001 >From: Stefan Metzmacher <metze@samba.org> >Date: Fri, 9 Nov 2012 09:01:29 +0100 >Subject: [PATCH 2/2] s4:samba-tool/testparm: report a CommandError if loading > of the config file fails > >Signed-off-by: Stefan Metzmacher <metze@samba.org> >--- > source4/scripting/python/samba/netcmd/testparm.py | 4 ++++ > 1 file changed, 4 insertions(+) > >diff --git a/source4/scripting/python/samba/netcmd/testparm.py b/source4/scripting/python/samba/netcmd/testparm.py >index 53357e4..a750391 100644 >--- a/source4/scripting/python/samba/netcmd/testparm.py >+++ b/source4/scripting/python/samba/netcmd/testparm.py >@@ -83,6 +83,10 @@ class cmd_testparm(Command): > "required for the host access check") > > lp = sambaopts.get_loadparm() >+ try: >+ lp = sambaopts.get_loadparm() >+ except Exception, err: >+ raise CommandError(err) > > # We need this to force the output > samba.set_debug_level(2) >-- >1.7.9.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
metze
:
review-
Actions:
View
Attachments on
bug 9373
:
8172
|
8173
|
8200