Fix PEP8 warning F841 local variable 'blah' is assigned to but never used
authorTim Beale <timbeale@catalyst.net.nz>
Fri, 27 Jul 2018 00:38:55 +0000 (12:38 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 17 Aug 2018 00:58:27 +0000 (02:58 +0200)
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/samba_tool/passwordsettings.py
source4/dsdb/tests/python/password_settings.py
source4/torture/drs/python/link_conflicts.py

index 89abfa019d84a43f23bb5be77201f6dc66490a5b..353756c4931da1928da5f06696b31c15b5fac397 100644 (file)
@@ -224,7 +224,7 @@ class PwdSettingsCmdTestCase(SambaToolCmdTest):
         """Tests we can delete a PSO using the samba-tool"""
 
         pso_name = "test-delete-PSO"
-        pso_settings = self._create_pso(pso_name)
+        self._create_pso(pso_name)
 
         # check we can successfully delete the PSO
         (result, out, err) = self.runsublevelcmd("domain", ("passwordsettings",
@@ -239,7 +239,7 @@ class PwdSettingsCmdTestCase(SambaToolCmdTest):
 
         # check the object no longer exists in the DB
         try:
-            res = self.ldb.search(dn, scope=ldb.SCOPE_BASE, attrs=['name'])
+            self.ldb.search(dn, scope=ldb.SCOPE_BASE, attrs=['name'])
             self.fail("PSO shouldn't exist")
         except ldb.LdbError as e:
             (enum, estr) = e.args
@@ -346,7 +346,7 @@ class PwdSettingsCmdTestCase(SambaToolCmdTest):
 
         # create a dummy PSO and a non-admin user
         pso_name = "test-unpriv-PSO"
-        test_pso = self._create_pso(pso_name)
+        self._create_pso(pso_name)
         user = TestUser("test-unpriv-user", self.ldb)
         self.obj_cleanup.append(user.dn)
         unpriv_auth = "-U%s%%%s" %(user.name, user.get_password())
index 6da33f84ce730547fc9fb9af9af2354bcf1503ac..f950a1d50e7a44ac7a6f11bb923074e93f503730 100644 (file)
@@ -842,7 +842,6 @@ unicodePwd:: %s
         self.set_domain_pwdHistoryLength("0")
         user = self.add_user("testuser")
 
-        initial_pwd = user.get_password()
         self.assert_password_valid(user, "NewPwd12#")
         # we can set the exact same password again because there's no history
         self.assert_password_valid(user, "NewPwd12#")
index 31ebc30fc446e062da6c2ada2edb334fef3b634f..0759b1ef1a71b0e8b440d33f34031a3acbf32933 100644 (file)
@@ -225,7 +225,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase):
         """
         # create unique objects for the link
         target_ou = self.unique_dn("OU=target")
-        target_guid = self.add_object(self.ldb_dc1, target_ou)
+        self.add_object(self.ldb_dc1, target_ou)
         src_ou = self.unique_dn("OU=src")
         src_guid = self.add_object(self.ldb_dc1, src_ou)
         self.sync_DCs()
@@ -312,7 +312,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase):
         src_dn = self.unique_dn("CN=src")
         src_guid = self.add_object(self.ldb_dc1, src_dn, objectclass="group")
         target_dn = self.unique_dn("CN=target")
-        target_guid = self.add_object(self.ldb_dc1, target_dn, objectclass="user")
+        self.add_object(self.ldb_dc1, target_dn, objectclass="user")
         self.sync_DCs()
 
         # link the src group to the same target user separately on each DC
@@ -392,7 +392,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase):
 
         # Add the link objects
         target_dn = self.unique_dn("CN=target")
-        target_guid = self.add_object(self.ldb_dc1, target_dn, objectclass="user")
+        self.add_object(self.ldb_dc1, target_dn, objectclass="user")
         src_dn = self.unique_dn("CN=src")
         src_guid = self.add_object(self.ldb_dc1, src_dn, objectclass="group")
         self.sync_DCs()
@@ -490,7 +490,7 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase):
         src_dn = self.unique_dn("CN=src")
         src_guid = self.add_object(self.ldb_dc1, src_dn, objectclass="group")
         target_dn = self.unique_dn("CN=target")
-        target1_guid = self.add_object(self.ldb_dc1, target_dn, objectclass="user")
+        self.add_object(self.ldb_dc1, target_dn, objectclass="user")
         self.sync_DCs()
 
         # add the same link on both DCs
@@ -699,9 +699,9 @@ class DrsReplicaLinkConflictTestCase(drs_base.DrsBaseTestCase):
         """
         # create some objects and add a link
         src_ou = self.unique_dn("OU=src")
-        src_guid = self.add_object(self.ldb_dc1, src_ou)
+        self.add_object(self.ldb_dc1, src_ou)
         target1_ou = self.unique_dn("OU=target1")
-        target1_guid = self.add_object(self.ldb_dc1, target1_ou)
+        self.add_object(self.ldb_dc1, target1_ou)
         self.add_link_attr(self.ldb_dc1, src_ou, "managedBy", target1_ou)
 
         # get the link info via replication