python: lint: fix pylint R1720 unnecessary "raise" after "else"
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 28 Mar 2024 03:15:06 +0000 (16:15 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 8 Apr 2024 03:00:39 +0000 (03:00 +0000)
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/netcmd/domain/auth/policy/policy.py
python/samba/netcmd/domain/auth/silo/silo.py
python/samba/netcmd/domain/claim/claim_type.py

index 5da74734f9d9dc2479442eee5cba60c7bc010493..207aa33c8d3b58ca532dbd1ff783407561c30114 100644 (file)
@@ -437,8 +437,8 @@ class cmd_domain_auth_policy_delete(Command):
             if not force:
                 raise CommandError(
                     f"{e}\nTry --force to delete protected authentication policies.")
-            else:
-                raise CommandError(e)
+
+            raise CommandError(e)
 
         # Authentication policy deleted successfully.
         print(f"Deleted authentication policy: {name}", file=self.outf)
index 028581a61c743b751ce0fdc179f3e21cfc485da8..2963ede64d41b31d0d291ea730d82d439d58de14 100644 (file)
@@ -378,8 +378,8 @@ class cmd_domain_auth_silo_delete(Command):
             if not force:
                 raise CommandError(
                     f"{e}\nTry --force to delete protected authentication silos.")
-            else:
-                raise CommandError(e)
+
+            raise CommandError(e)
 
         # Authentication silo deleted successfully.
         print(f"Deleted authentication silo: {name}", file=self.outf)
index fffc100e103fa51e62df9e51f30901daac11b625..3bd91e13a6a966500a86f525f794dd820d03a2c8 100644 (file)
@@ -244,8 +244,8 @@ class cmd_domain_claim_claim_type_delete(Command):
             if not force:
                 raise CommandError(
                     f"{e}\nTry --force to delete protected claim types.")
-            else:
-                raise CommandError(e)
+
+            raise CommandError(e)
 
         # Claim type deleted successfully.
         print(f"Deleted claim type: {name}", file=self.outf)