python: Remove unnecessary 'pass' statements
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 5 May 2022 09:11:07 +0000 (21:11 +1200)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 10 May 2022 05:19:34 +0000 (05:19 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
buildtools/wafsamba/samba_perl.py
python/samba/dbchecker.py
python/samba/emulate/traffic.py
python/samba/join.py
python/samba/netcmd/__init__.py
python/samba/netcmd/computer.py
python/samba/netcmd/domain.py
python/samba/remove_dc.py
script/attr_count_read
source4/scripting/devel/demodirsync.py
source4/scripting/devel/pfm_verify.py

index e019acb0fa17d35775b3583eb3e5f121e287e9b6..b4263137b591ea27bdb2bc435b7c68c5694f12ba 100644 (file)
@@ -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')
index eb6dfe97cb0d2f86fc407939202f66e4cf6f06aa..449b0a7d985c45624a5d4ae03167c547f109ffc1 100644 (file)
@@ -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):
index e3f281f2327ce387fa2a0fa1200576fda545940a..c141e36b6291563777a5dc65c6cb1ee8d87a0888 100644 (file)
@@ -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')
 
index 91ed6da11473ec561160efa55f893f67160b4303..97561323f21d8594d8f9679d004541508b3f966c 100644 (file)
@@ -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:
index 62fe1380d5298cd5f331fe74b6ae8ebec7da7beb..bb70f72449ef116625c4c3e177f0b4c05f155428 100644 (file)
@@ -29,7 +29,6 @@ import textwrap
 
 class Option(SambaOption):
     SUPPRESS_HELP = optparse.SUPPRESS_HELP
-    pass
 
 # This help formatter does text wrapping and preserves newlines
 
index 8fa0ab8d1e979b453d300bd3ca7d1d59e0d01031..e4fbd6712229b1674a72488d13ca7a89616a6f36 100644 (file)
@@ -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:
index 49e60625e44fb7cb451cd258d634b8c007527abe..4d8e5b7387e20279dc6605fb4a28bc64ffcd6bbe 100644 (file)
@@ -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 \
index 30abb385491960c61fc7b29eef5263ddb549bb7a..eba597a42ebf74ca25ddd35b075a46603943bdc3 100644 (file)
@@ -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(
index eecdf57707b455de62b83af37497d67c1426766e..c49e55d34194f4b635b639d64f763572e2e0444d 100755 (executable)
@@ -155,7 +155,6 @@ def print_counts(count_data):
 
     for attr, row in rows.items():
         print(t % tuple(row))
-        pass
 
 
 def main():
index 06eacf335a5197eeea87e9bcaf1c787758c5be82..09c316a67d1b74e68432d8773d16cb51c0f0dbf8 100755 (executable)
@@ -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)
index 2fe2aca65bc454df1341cf771ed8ffb5f40f0f7e..f29c1e52e37380444c7f0aa976f098137c8205ee 100755 (executable)
@@ -165,7 +165,6 @@ if __name__ == "__main__":
 
     if creds.is_anonymous():
         parser.error("You must supply credentials")
-        pass
 
     server = args[0]