From ba54c9cc067993aed21e97618cc0f1f58a5034e8 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Thu, 5 May 2022 21:11:07 +1200 Subject: [PATCH] python: Remove unnecessary 'pass' statements Signed-off-by: Joseph Sutton Reviewed-by: Andreas Schneider --- buildtools/wafsamba/samba_perl.py | 1 - python/samba/dbchecker.py | 2 -- python/samba/emulate/traffic.py | 2 -- python/samba/join.py | 1 - python/samba/netcmd/__init__.py | 1 - python/samba/netcmd/computer.py | 1 - python/samba/netcmd/domain.py | 1 - python/samba/remove_dc.py | 2 -- script/attr_count_read | 1 - source4/scripting/devel/demodirsync.py | 1 - source4/scripting/devel/pfm_verify.py | 1 - 11 files changed, 14 deletions(-) diff --git a/buildtools/wafsamba/samba_perl.py b/buildtools/wafsamba/samba_perl.py index e019acb0fa1..b4263137b59 100644 --- a/buildtools/wafsamba/samba_perl.py +++ b/buildtools/wafsamba/samba_perl.py @@ -28,7 +28,6 @@ def SAMBA_CHECK_PERL(conf, mandatory=True, version=(5,0,0)): return v except IndexError: conf.end_msg(False, 'YELLOW') - pass return None vendor_prefix = check_perl_config_var('vendorprefix') diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index eb6dfe97cb0..449b0a7d985 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -135,7 +135,6 @@ class dbcheck(object): (enum, estr) = e5.args if enum != ldb.ERR_NO_SUCH_OBJECT: raise - pass self.system_session_info = system_session() self.admin_session_info = admin_session(None, samdb.get_domain_sid()) @@ -237,7 +236,6 @@ class dbcheck(object): (enum, estr) = e6.args if enum != ldb.ERR_NO_SUCH_OBJECT: raise - pass def check_database(self, DN=None, scope=ldb.SCOPE_SUBTREE, controls=None, attrs=None): diff --git a/python/samba/emulate/traffic.py b/python/samba/emulate/traffic.py index e3f281f2327..c141e36b629 100644 --- a/python/samba/emulate/traffic.py +++ b/python/samba/emulate/traffic.py @@ -1588,7 +1588,6 @@ def replay_seq_in_fork(cs, start, context, account, client_id, server_id=1): os.close(1) except IOError as e: LOGGER.info("stdout closing failed with %s" % e) - pass sys.stdout = f now = time.time() - start @@ -1630,7 +1629,6 @@ def dnshammer_in_fork(dns_rate, duration, context, query_file=None): os.close(1) except IOError as e: LOGGER.warn("stdout closing failed with %s" % e) - pass filename = os.path.join(context.statsdir, 'stats-dns') sys.stdout = open(filename, 'w') diff --git a/python/samba/join.py b/python/samba/join.py index 91ed6da1147..97561323f21 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -1131,7 +1131,6 @@ class DCJoinContext(object): except WERRORError as e: if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST: name_found = False - pass if name_found: for rec in res.rec: diff --git a/python/samba/netcmd/__init__.py b/python/samba/netcmd/__init__.py index 62fe1380d52..bb70f72449e 100644 --- a/python/samba/netcmd/__init__.py +++ b/python/samba/netcmd/__init__.py @@ -29,7 +29,6 @@ import textwrap class Option(SambaOption): SUPPRESS_HELP = optparse.SUPPRESS_HELP - pass # This help formatter does text wrapping and preserves newlines diff --git a/python/samba/netcmd/computer.py b/python/samba/netcmd/computer.py index 8fa0ab8d1e9..e4fbd671222 100644 --- a/python/samba/netcmd/computer.py +++ b/python/samba/netcmd/computer.py @@ -105,7 +105,6 @@ def add_dns_records( except WERRORError as e: if e.args[0] == werror.WERR_DNS_ERROR_NAME_DOES_NOT_EXIST: name_found = False - pass if name_found: for rec in res.rec: diff --git a/python/samba/netcmd/domain.py b/python/samba/netcmd/domain.py index 49e60625e44..4d8e5b7387e 100644 --- a/python/samba/netcmd/domain.py +++ b/python/samba/netcmd/domain.py @@ -2877,7 +2877,6 @@ class cmd_domain_trust_delete(DomainTrustCommand): if not self.check_runtime_error(error, ntstatus.NT_STATUS_OBJECT_NAME_NOT_FOUND): raise self.RemoteRuntimeError(self, error, "QueryTrustedDomainInfoByName(%s)" % ( lsaString.string)) - pass if remote_tdo_info is not None: if local_lsa_info.sid != remote_tdo_info.sid or \ diff --git a/python/samba/remove_dc.py b/python/samba/remove_dc.py index 30abb385491..eba597a42eb 100644 --- a/python/samba/remove_dc.py +++ b/python/samba/remove_dc.py @@ -405,7 +405,6 @@ def remove_dc(samdb, logger, dc_name): ntds_dn = ldb.Dn(samdb, "CN=NTDS Settings") ntds_dn.add_base(server_dn) - pass # Confirm this is really an ntdsDSA object try: @@ -415,7 +414,6 @@ def remove_dc(samdb, logger, dc_name): (enum, estr) = e7.args if enum == ldb.ERR_NO_SUCH_OBJECT: ntds_msgs = [] - pass else: samdb.transaction_cancel() raise DemoteException( diff --git a/script/attr_count_read b/script/attr_count_read index eecdf57707b..c49e55d3419 100755 --- a/script/attr_count_read +++ b/script/attr_count_read @@ -155,7 +155,6 @@ def print_counts(count_data): for attr, row in rows.items(): print(t % tuple(row)) - pass def main(): diff --git a/source4/scripting/devel/demodirsync.py b/source4/scripting/devel/demodirsync.py index 06eacf335a5..09c316a67d1 100755 --- a/source4/scripting/devel/demodirsync.py +++ b/source4/scripting/devel/demodirsync.py @@ -59,7 +59,6 @@ if (len(ctrls)): if arr[0] == 'dirsync': cookie = ndr_unpack(drsblobs.ldapControlDirSyncCookie, base64.b64decode(arr[3])) guid = cookie.blob.guid1 - pass if not guid: print("No dirsync control ... strange") sys.exit(1) diff --git a/source4/scripting/devel/pfm_verify.py b/source4/scripting/devel/pfm_verify.py index 2fe2aca65bc..f29c1e52e37 100755 --- a/source4/scripting/devel/pfm_verify.py +++ b/source4/scripting/devel/pfm_verify.py @@ -165,7 +165,6 @@ if __name__ == "__main__": if creds.is_anonymous(): parser.error("You must supply credentials") - pass server = args[0]