[PATCH] samba-tool dns: Give a better error message when people get the server parameter wrong

Kai Blin kai at samba.org
Wed Nov 14 03:37:01 MST 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If people call e.g. samba-tool dns serverinfo localhost, samba-tool
gives a pretty confusing backtrace like

ERROR(runtime): uncaught exception - (-1073741801, 'Memory allocation
error')
  File "bin/python/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "bin/python/samba/netcmd/dns.py", line 699, in run
    dns_conn = dns_connect(server, self.lp, self.creds)
  File "bin/python/samba/netcmd/dns.py", line 35, in dns_connect
    dns_conn = dnsserver.dnsserver(binding_str, lp, creds)

The attached patch tries a simple heuristic to improve the error message.

I'm aware it's not perfect, but I assume the most common way to call
samba-tool dns is against the local host, so this easy check should
make the error output more easy to understand for most people.

Can someone ack and push or propose a better patch?

Cheers,
Kai

- -- 
Kai Blin
Worldforge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin
Samba team member http://www.samba.org/samba/team/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCjdEYACgkQEKXX/bF2FpRrgwCdFe+knPs0+En8obAKZahvQ5XT
WFkAn3+s+OAxJE1mYh8t12koKjM2JJaX
=Lf7c
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-samba-tool-dns-Give-a-better-error-message-when-peop.patch
Type: text/x-patch
Size: 971 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121114/29fee1c2/attachment.bin>


More information about the samba-technical mailing list