python: Print the finddcs error message
[metze/samba/wip.git] / python / samba / netcmd / domain.py
index ada7d6b5f3640eb93004fac66a234249b4de5292..2cb14f150ecbe848ba284022d9934cb3ccba43af 100644 (file)
@@ -1771,6 +1771,9 @@ class DomainTrustCommand(Command):
             if require_pdc:
                 remote_flags |= nbt.NBT_SERVER_PDC
             remote_info = remote_net.finddc(flags=remote_flags, domain=domain, address=remote_server)
+        except NTSTATUSError as error:
+            raise CommandError("Failed to find a writeable DC for domain '%s': %s" %
+                               (domain, error[1]))
         except Exception:
             raise CommandError("Failed to find a writeable DC for domain '%s'" % domain)
         flag_map = {