From: Joseph Sutton Date: Wed, 2 Aug 2023 21:45:47 +0000 (+1200) Subject: s4:dsdb:tests: Remove unused variables X-Git-Tag: tevent-0.16.0~1107 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=178a7ed8a9c32d82b26108589ab5f82b1779cfbc;p=thirdparty%2Fsamba.git s4:dsdb:tests: Remove unused variables Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/tests/python/ldap_schema.py b/source4/dsdb/tests/python/ldap_schema.py index b08aa7f6859..e2fceb79d6c 100755 --- a/source4/dsdb/tests/python/ldap_schema.py +++ b/source4/dsdb/tests/python/ldap_schema.py @@ -229,7 +229,6 @@ name: """ + object_name + """ self.assertTrue("replPropertyMetaData" in obj_res[0]) val = obj_res[0]["replPropertyMetaData"][0] repl = ndr_unpack(drsblobs.replPropertyMetaDataBlob, val) - obj = repl.ctr # Windows 2000 functional level won't have this. It is too # hard to work it out from the prefixmap however, so we skip @@ -306,7 +305,6 @@ instanceType: 4 """Testing creating a duplicate attribute""" rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand - attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.2." + rand ldif = """ dn: CN=%s,%s""" % (attr_name, self.schema_dn) + """ @@ -349,7 +347,6 @@ systemOnly: FALSE """Testing creating a duplicate attribute and class""" rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand - attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.3." + rand ldif = """ dn: CN=%s,%s""" % (attr_name, self.schema_dn) + """ @@ -393,7 +390,6 @@ systemOnly: FALSE """Testing creating a duplicate attribute""" rand = str(random.randint(1, 100000)) attr_name = "test-Attr" + time.strftime("%s", time.gmtime()) + "-" + rand - attr_ldap_display_name = attr_name.replace("-", "") attributeID = "1.3.6.1.4.1.7165.4.6.1.6.4." + rand ldif = """ dn: CN=%s,%s""" % (attr_name, self.schema_dn) + """ diff --git a/source4/dsdb/tests/python/sec_descriptor.py b/source4/dsdb/tests/python/sec_descriptor.py index 4e3230f3548..1f22b2bfa4f 100755 --- a/source4/dsdb/tests/python/sec_descriptor.py +++ b/source4/dsdb/tests/python/sec_descriptor.py @@ -571,7 +571,6 @@ class OwnerGroupDescriptorTests(DescriptorTests): delete_force(self.ldb_admin, object_dn) _ldb.newuser("test_domain_user1", "samba123@", userou="OU=test_domain_ou1", sd=tmp_desc, setpassword=False) - desc = self.sd_utils.read_sd_on_dn(object_dn) desc_sddl = self.sd_utils.get_sd_as_sddl(object_dn) res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1) self.assertEqual(self.results[self.DS_BEHAVIOR][self._testMethodName[5:]] % str(user_sid), res) @@ -598,7 +597,6 @@ class OwnerGroupDescriptorTests(DescriptorTests): delete_force(self.ldb_admin, object_dn) _ldb.newuser("test_domain_user1", "samba123@", userou="OU=test_domain_ou1", sd=tmp_desc, setpassword=False) - desc = self.sd_utils.read_sd_on_dn(object_dn) desc_sddl = self.sd_utils.get_sd_as_sddl(object_dn) res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1) self.assertEqual(self.results[self.DS_BEHAVIOR][self._testMethodName[5:]] % str(user_sid), res) @@ -697,13 +695,12 @@ class OwnerGroupDescriptorTests(DescriptorTests): # Open Ldb connection with the tested user _ldb = self.get_ldb_connection(user_name, "samba123@") # Change Schema partition descriptor - user_sid = self.sd_utils.get_object_sid(self.get_users_domain_dn(user_name)) mod = "(A;CI;WDCC;;;AU)" self.sd_utils.dacl_add_ace(self.schema_dn, mod) # Create example Schema class try: class_dn = self.create_schema_class(_ldb) - except LdbError as e3: + except LdbError: self.fail() desc_sddl = self.sd_utils.get_sd_as_sddl(class_dn) res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1) @@ -998,7 +995,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): delete_force(self.ldb_admin, object_dn) try: self.create_configuration_specifier(_ldb, object_dn) - except LdbError as e3: + except LdbError: self.fail() desc_sddl = self.sd_utils.get_sd_as_sddl(object_dn) res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1) @@ -1140,7 +1137,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): desc_sddl = "O:%sG:DAD:(A;;RP;;;DU)" % str(user_sid) try: self.create_configuration_specifier(_ldb, object_dn, desc_sddl) - except LdbError as e3: + except LdbError: self.fail() desc_sddl = self.sd_utils.get_sd_as_sddl(object_dn) res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1) @@ -1166,7 +1163,7 @@ class OwnerGroupDescriptorTests(DescriptorTests): desc_sddl = "O:%sG:DAD:(A;;RP;;;DU)" % str(user_sid) try: self.create_configuration_specifier(_ldb, object_dn, desc_sddl) - except LdbError as e3: + except LdbError: self.fail() desc_sddl = self.sd_utils.get_sd_as_sddl(object_dn) res = re.search("(O:.*G:.*?)D:", desc_sddl).group(1)