From: Jennifer Sutton Date: Thu, 29 Aug 2024 01:30:49 +0000 (+1200) Subject: python: Tidy up formatting X-Git-Tag: tevent-0.17.0~138 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51e14680b96c4b6597717eea309bca3d53989436;p=thirdparty%2Fsamba.git python: Tidy up formatting BUG: https://bugzilla.samba.org/show_bug.cgi?id=15852 Signed-off-by: Jennifer Sutton Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/drs_utils.py b/python/samba/drs_utils.py index ab2d37e133c..3b3a42df178 100644 --- a/python/samba/drs_utils.py +++ b/python/samba/drs_utils.py @@ -163,7 +163,7 @@ def drs_get_rodc_partial_attribute_set(samdb): continue if "searchFlags" in r: search_flags = r["searchFlags"][0] - if (int(search_flags) & dsdb.SEARCH_FLAG_RODC_ATTRIBUTE): + if int(search_flags) & dsdb.SEARCH_FLAG_RODC_ATTRIBUTE: continue attid = samdb.get_attid_from_lDAPDisplayName(ldap_display_name) attids.append(int(attid)) @@ -171,7 +171,7 @@ def drs_get_rodc_partial_attribute_set(samdb): # the attids do need to be sorted, or windows doesn't return # all the attributes we need attids.sort() - partial_attribute_set.attids = attids + partial_attribute_set.attids = attids partial_attribute_set.num_attids = len(attids) return partial_attribute_set @@ -319,8 +319,7 @@ class drs_Replicate(object): drsuapi.DRSUAPI_DRS_NEVER_SYNCED | drsuapi.DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP) if rodc: - req.replica_flags |= ( - drsuapi.DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING) + req.replica_flags |= drsuapi.DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING else: req.replica_flags |= drsuapi.DRSUAPI_DRS_WRIT_REP @@ -361,7 +360,6 @@ class drs_Replicate(object): except WERRORError as e: # Check if retrying with the GET_TGT flag set might resolve this error if self._should_retry_with_get_tgt(e.args[0], req): - print("Missing target object - retrying with DRS_GET_TGT") req.more_flags |= drsuapi.DRSUAPI_DRS_GET_TGT @@ -370,8 +368,7 @@ class drs_Replicate(object): first_chunk = True continue - if self._should_calculate_missing_anc_locally(e.args[0], - req): + if self._should_calculate_missing_anc_locally(e.args[0], req): print("Missing parent object - calculating missing objects locally") self._calculate_missing_anc_locally(ctr) @@ -422,14 +419,13 @@ class drs_ReplicateRenamer(drs_Replicate): if attr.attid == DRSUAPI_ATTID_name: base_dn = ldb.Dn(self.samdb, base_obj.identifier.dn) new_name = base_dn.get_rdn_value() - attr.value_ctr.values[0].blob = new_name.encode('utf-16-le') + attr.value_ctr.values[0].blob = new_name.encode("utf-16-le") def rename_top_level_object(self, first_obj): """Renames the first/top-level object in a partition""" old_dn = first_obj.identifier.dn first_obj.identifier.dn = self.rename_dn(first_obj.identifier.dn) - print("Renaming partition %s --> %s" % (old_dn, - first_obj.identifier.dn)) + print("Renaming partition %s --> %s" % (old_dn, first_obj.identifier.dn)) # we also need to fix up the 'name' attribute for the base DN, # otherwise the RDNs won't match