join: Fix TypeError when handling exception
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 16 Jan 2019 02:17:38 +0000 (15:17 +1300)
committerJeremy Allison <jra@samba.org>
Wed, 16 Jan 2019 17:51:27 +0000 (18:51 +0100)
commit3bb7808984c163a7bba66fb983411d1281589722
treeab98a30d10c1332fb52dc39c08d35e55b5592c74
parente68dd420b45a3f7d9ce3b08e866c5495be18b725
join: Fix TypeError when handling exception

When we can't resolve a domain name, we were inadvertently throwing a
TypeError whilst trying to output a helpful message. E.g.

ERROR(<class 'TypeError'>): uncaught exception - 'NTSTATUSError' object
does not support indexing

Instead of indexing the object, we want to index the Exception.args so
that we just display the string portion of the exception error.

The same problem is also present for the domain trust commands.

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

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Jeremy Allison <rpenny@samba.org>
python/samba/join.py
python/samba/netcmd/domain.py