samba-tool domain demote: Fix error handling and error messages
authorAndrew Bartlett <abartlet@samba.org>
Wed, 20 Apr 2016 20:16:19 +0000 (08:16 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 2 Jun 2016 14:36:15 +0000 (16:36 +0200)
Due to an error in a previous patch, e was undefined

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/netcmd/domain.py

index 68775ec4f113095b541501872ebe25bd3a9d15d6..8437455c6f8d4f0156e021866f0378274e3d919a 100644 (file)
@@ -789,12 +789,12 @@ class cmd_domain_demote(Command):
                         pass
                     else:
                         self.errf.write(
-                            "Error while demoting, "
-                        "re-enabling inbound replication\n")
+                            "Error while replicating out last local changes from '%s' for demotion, "
+                            "re-enabling inbound replication\n" % part)
                         dsa_options ^= DS_NTDSDSA_OPT_DISABLE_INBOUND_REPL
                         nmsg["options"] = ldb.MessageElement(str(dsa_options), ldb.FLAG_MOD_REPLACE, "options")
                         samdb.modify(nmsg)
-                        raise CommandError("Error while sending a DsReplicaSync for partion %s" % str(part), e)
+                        raise CommandError("Error while sending a DsReplicaSync for partition '%s'" % str(part), string)
         try:
             remote_samdb = SamDB(url="ldap://%s" % server,
                                 session_info=system_session(),