python/samba: Bulk replace of '.next()' method with function 'next()'
authorNoel Power <noel.power@suse.com>
Fri, 4 May 2018 10:22:43 +0000 (11:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 12 May 2018 19:38:16 +0000 (21:38 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/idmap.py
python/samba/netcmd/user.py
source4/scripting/bin/smbstatus

index 0cb729fbc29fb9824a4c9d91434eabe0f801a971..a618347fa212638f2b96e6975bca600ec96cb685 100644 (file)
@@ -95,4 +95,4 @@ type: %s
 cn: %s
 
 """ % (sid, unixid, sid, type_string, sid)
-        self.add(self.parse_ldif(mod).next()[1])
+        self.add(next(self.parse_ldif(mod))[1])
index 1e2e040e934f1a83154eb28881d32d6c425b8316..f849e6ee837fd9cd3e35572bca82d64e37a70188 100644 (file)
@@ -1879,7 +1879,7 @@ samba-tool user syncpasswords --terminate \\
                 self.current_pid = None
                 self.outf.write("Initialized cache_ldb[%s]\n" % (cache_ldb))
                 msgs = self.cache.parse_ldif(add_ldif)
-                changetype,msg = msgs.next()
+                changetype,msg = next(msgs)
                 ldif = self.cache.write_ldif(msg, ldb.CHANGETYPE_NONE)
                 self.outf.write("%s" % ldif)
             else:
index 7ff98df6b3ed7152f20a9fde4207f86980820f8b..473dbaf2ce4bdd4c58c7abba17d94d6ddd61ec7c 100755 (executable)
@@ -26,7 +26,7 @@ from samba import irpc, messaging
 def show_sessions(conn):
     """show open sessions"""
 
-    sessions = conn.smbsrv_information(irpc.SMBSRV_INFO_SESSIONS).next()
+    sessions = next(conn.smbsrv_information(irpc.SMBSRV_INFO_SESSIONS))
     print "User                                  Client      Connected at"
     print "-" * 79
     for session in sessions:
@@ -37,7 +37,7 @@ def show_sessions(conn):
 def show_tcons(open_connection):
     """show open tree connects"""
     conn = open_connection("smb_server")
-    tcons = conn.smbsrv_information(irpc.SMBSRV_INFO_TCONS).next()
+    tcons = next(conn.smbsrv_information(irpc.SMBSRV_INFO_TCONS))
     print "Share                                 Client      Connected at"
     print "-" * 79
     for tcon in tcons:
@@ -47,7 +47,7 @@ def show_tcons(open_connection):
 def show_nbt(open_connection):
     """show nbtd information"""
     conn = open_connection("nbt_server")
-    stats = conn.nbtd_information(irpc.NBTD_INFO_STATISTICS).next()
+    stats = next(conn.nbtd_information(irpc.NBTD_INFO_STATISTICS))
     print "NBT server statistics:"
     fields = [("total_received", "Total received"),
               ("total_sent", "Total sent"),