dsdb: Remove calls to ldb.set_opaque_integer()
authorAndrew Bartlett <abartlet@samba.org>
Mon, 4 Mar 2024 01:44:53 +0000 (14:44 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 5 Mar 2024 02:54:36 +0000 (02:54 +0000)
This routine will shortly be removed, it is now replaced by an
improved ldb.set_opaque()

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jo Sutton <josutton@catalyst.net.nz>
python/samba/join.py
python/samba/provision/__init__.py
source4/torture/drs/python/ridalloc_exop.py

index 8b7e882a236c160c96bbf14745d3da36d5ae9860..724dd6e258e13db59c58a3985a3fbf83727811a1 100644 (file)
@@ -1096,11 +1096,11 @@ class DCJoinContext(object):
             # was sent, as we are processing all links in the
             # transaction_commit().
             if not ctx.domain_replica_flags & drsuapi.DRSUAPI_DRS_CRITICAL_ONLY:
-                ctx.local_samdb.set_opaque_integer(dsdb.DSDB_FULL_JOIN_REPLICATION_COMPLETED_OPAQUE_NAME,
-                                                   1)
+                ctx.local_samdb.set_opaque(dsdb.DSDB_FULL_JOIN_REPLICATION_COMPLETED_OPAQUE_NAME,
+                                           1)
             ctx.local_samdb.transaction_commit()
-            ctx.local_samdb.set_opaque_integer(dsdb.DSDB_FULL_JOIN_REPLICATION_COMPLETED_OPAQUE_NAME,
-                                               0)
+            ctx.local_samdb.set_opaque(dsdb.DSDB_FULL_JOIN_REPLICATION_COMPLETED_OPAQUE_NAME,
+                                       0)
             ctx.logger.info("Committed SAM database")
 
         # A large replication may have caused our LDB connection to the
@@ -1320,8 +1320,8 @@ class DCJoinContext(object):
         if ctx.RODC:
             print("Setting RODC invocationId")
             ctx.local_samdb.set_invocation_id(str(ctx.invocation_id))
-            ctx.local_samdb.set_opaque_integer("domainFunctionality",
-                                               ctx.behavior_version)
+            ctx.local_samdb.set_opaque("domainFunctionality",
+                                       ctx.behavior_version)
             m = ldb.Message()
             m.dn = ldb.Dn(ctx.local_samdb, "%s" % ctx.ntds_dn)
             m["invocationId"] = ldb.MessageElement(ndr_pack(ctx.invocation_id),
index c7f761cd75c1a824f9d280b0e0ee759d61ad81b5..80684c4752224f22a5745603972cd916267e75e4 100644 (file)
@@ -1381,10 +1381,10 @@ def fill_samdb(samdb, lp, names, logger, policyguid,
 
     # These will be fixed into the database via the database
     # modifictions below, but we need them set from the start.
-    samdb.set_opaque_integer("domainFunctionality", domainFunctionality)
-    samdb.set_opaque_integer("forestFunctionality", forestFunctionality)
-    samdb.set_opaque_integer("domainControllerFunctionality",
-                             domainControllerFunctionality)
+    samdb.set_opaque("domainFunctionality", domainFunctionality)
+    samdb.set_opaque("forestFunctionality", forestFunctionality)
+    samdb.set_opaque("domainControllerFunctionality",
+                     domainControllerFunctionality)
 
     samdb.set_domain_sid(str(names.domainsid))
     samdb.set_invocation_id(invocationid)
index ecd5cec6f4e59db55b1cb02abdc2615fa0bbbc00..2ac64c05d3bbd9ba4a21b1acfa6b205ec4337976 100644 (file)
@@ -736,8 +736,8 @@ class DrsReplicaSyncTestCase(drs_base.DrsBaseTestCase):
             # simulates getting the delete in the replciation stream.
             new_ldb.deleteuser(test_user4)
 
-            new_ldb.set_opaque_integer(dsdb.DSDB_FULL_JOIN_REPLICATION_COMPLETED_OPAQUE_NAME,
-                                       1)
+            new_ldb.set_opaque(dsdb.DSDB_FULL_JOIN_REPLICATION_COMPLETED_OPAQUE_NAME,
+                               1)
 
             # This should now work
             try: