Python exceptions should be caught and prettified. For example: $ samba-tool dns zonelist kaylee Password for [administrator@FIREFLY.MICHAEL.MOL.NAME]: Failed to bind to uuid 50abc2a4-574d-40b3-9d66-ee4fd5fba076 for 50abc2a4-574d-40b3-9d66-ee4fd5fba076@ncacn_ip_tcp:kaylee[1024,sign] NT_STATUS_IO_TIMEOUT ERROR(runtime): uncaught exception - (-1073741643, 'NT_STATUS_IO_TIMEOUT') File "/usr/lib64/python2.7/site-packages/samba/netcmd/__init__.py", line 175, in _run return self.run(*args, **kwargs) File "/usr/lib64/python2.7/site-packages/samba/netcmd/dns.py", line 804, in run dns_conn = dns_connect(server, self.lp, self.creds) File "/usr/lib64/python2.7/site-packages/samba/netcmd/dns.py", line 37, in dns_connect dns_conn = dnsserver.dnsserver(binding_str, lp, creds) While I can spot what happened (I took too long to enter my password, leading to a timeout), it requires spotting the NT_STATUS_IO_TIMEOUT inside a wall of text. Better output would be: $ samba-tool dns zonelist kaylee Password for [administrator@FIREFLY.MICHAEL.MOL.NAME]: Failed to bind to uuid 50abc2a4-574d-40b3-9d66-ee4fd5fba076 for 50abc2a4-574d-40b3-9d66-ee4fd5fba076@ncacn_ip_tcp:kaylee[1024,sign] NT_STATUS_IO_TIMEOUT Protocol timed out. (The key difference being the descriptor string "Protocol timed out." instead of the exception stack.)
I think that this is an ENHANCEMENT. Jelmer, do you have any further opinion on this one?
(In reply to comment #1) > I think that this is an ENHANCEMENT. > > Jelmer, do you have any further opinion on this one? We have infrastructure to display exceptions as regular user errors. In this particular case, it's an internal exception that's caught and so we print a backtrace. The correct fix here is to catch this exception and throw a CommandError instead.
This example would have been improved with commit 5701b99b5c134ee6ffffa0f34c2797c9c814d280. Now you'll only see something like: Connecting to DNS RPC server kaylee failed with (-1073741643, 'NT_STATUS_IO_TIMEOUT') which is *somewhat* better.