diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2018-03-12 12:33:01 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-05-31 01:57:16 +0200 |
commit | 35ab60b82a32f9be18fa49f17a47781989f7cd66 (patch) | |
tree | a7b4956cccbc74d979253027d254f975e8efdbe4 /python | |
parent | 23001c2835a3d7e127ce54ffe7a9ef69bcadbf91 (diff) | |
download | samba-35ab60b82a32f9be18fa49f17a47781989f7cd66.tar.gz |
samba-tool drs replicate: reformat drs_local_replicate method
line length.
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/netcmd/drs.py | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/python/samba/netcmd/drs.py b/python/samba/netcmd/drs.py index 7dabdcc24ab..a8c096b24bd 100644 --- a/python/samba/netcmd/drs.py +++ b/python/samba/netcmd/drs.py @@ -330,7 +330,8 @@ class cmd_drs_replicate(Command): Option("--single-object", help="Replicate only the object specified, instead of the whole Naming Context (only with --local)", action="store_true"), ] - def drs_local_replicate(self, SOURCE_DC, NC, full_sync=False, single_object=False, + def drs_local_replicate(self, SOURCE_DC, NC, full_sync=False, + single_object=False, sync_forced=False): '''replicate from a source DC to the local SAM''' @@ -351,7 +352,9 @@ class cmd_drs_replicate(Command): res = self.local_samdb.search(base=self.ntds_dn, scope=ldb.SCOPE_BASE, attrs=["objectGUID"]) - self.ntds_guid = misc.GUID(self.samdb.schema_format_value("objectGUID", res[0]["objectGUID"][0])) + self.ntds_guid = misc.GUID( + self.samdb.schema_format_value("objectGUID", + res[0]["objectGUID"][0])) source_dsa_invocation_id = misc.GUID(self.samdb.get_invocation_id()) dest_dsa_invocation_id = misc.GUID(self.local_samdb.get_invocation_id()) @@ -364,27 +367,36 @@ class cmd_drs_replicate(Command): full_sync = True self.samdb.transaction_start() - repl = drs_utils.drs_Replicate("ncacn_ip_tcp:%s[seal]" % self.server, self.lp, - self.creds, self.local_samdb, dest_dsa_invocation_id) + repl = drs_utils.drs_Replicate("ncacn_ip_tcp:%s[seal]" % self.server, + self.lp, + self.creds, self.local_samdb, + dest_dsa_invocation_id) # Work out if we are an RODC, so that a forced local replicate # with the admin pw does not sync passwords rodc = self.local_samdb.am_rodc() try: (num_objects, num_links) = repl.replicate(NC, - source_dsa_invocation_id, destination_dsa_guid, - rodc=rodc, full_sync=full_sync, - exop=exop, sync_forced=sync_forced) + source_dsa_invocation_id, + destination_dsa_guid, + rodc=rodc, + full_sync=full_sync, + exop=exop, + sync_forced=sync_forced) except Exception as e: raise CommandError("Error replicating DN %s" % NC, e) self.samdb.transaction_commit() if full_sync: - self.message("Full Replication of all %d objects and %d links from %s to %s was successful." - % (num_objects, num_links, SOURCE_DC, self.local_samdb.url)) + self.message("Full Replication of all %d objects and %d links " + "from %s to %s was successful." % + (num_objects, num_links, SOURCE_DC, + self.local_samdb.url)) else: - self.message("Incremental replication of %d objects and %d links from %s to %s was successful." - % (num_objects, num_links, SOURCE_DC, self.local_samdb.url)) + self.message("Incremental replication of %d objects and %d links " + "from %s to %s was successful." % + (num_objects, num_links, SOURCE_DC, + self.local_samdb.url)) def run(self, DEST_DC, SOURCE_DC, NC, add_ref=False, sync_forced=False, sync_all=False, full_sync=False, |